Optimizing Runtime Performance of Dynamically Typed Code

Total Page:16

File Type:pdf, Size:1020Kb

Optimizing Runtime Performance of Dynamically Typed Code Optimizing Runtime Performance of Dynamically Typed Code Jose Quiroga Alvarez PhD Supervisor Dr. Francisco Ort´ınSoler Department of Computer Science University of Oviedo A thesis submitted for the degree of Doctor of Philosophy Oviedo, Spain April 2016 Acknowledgements This work has been partially funded by the Spanish Department of Science and Technology, under the National Program for Research, Development and Innovation. The main project was Obtaining Adapt- able, Robust and Efficient Software by including Structural Reflection to Statically Typed Programming Languages (TIN2011-25978). The work is also part of the project entitled Improving Performance and Robustness of Dynamic Languages to develop Efficient, Scalable and Reliable Software (TIN2008-00276). I was awarded a FPI grant by the Spanish Department of Science and Technology. The objective of these grants is to support gradu- ate students wishing to pursue a PhD degree associated to a specific research project. This PhD dissertation is associated to the project TIN2011-25978 (previous paragraph). This work has also been funded by Microsoft Research, under the project entitled Extending dynamic features of the SSCLI, awarded in the Phoenix and SSCLI, Compilation and Managed Execution Request for Proposals. Part of the research discussed in this dissertation has also been funded by the European Union, through the European Regional Development Funds (ERDF); and the Principality of Asturias, through its Science, Innovation Plan (grant GRUPIN14-100). Abstract Dynamic languages are widely used for different kinds of applications including rapid prototyping, Web development and programs that require a high level of runtime adaptiveness. However, the lack of compile-time type information involves fewer opportunities for com- piler optimizations, and no detection of type errors at compile time. In order to provide the benefits of static and dynamic typing, hybrid typing languages provide both typing approaches in the very same programming language. Nevertheless, dynamically typed code in this languages still shows lower performance and lacks early type error detection. The main objective of this PhD dissertation is to optimize runtime performance of dynamically typed code. For this purpose, we have defined three optimizations applicable to both dynamic and hybrid typing languages. The proposed optimizations have been included in an existing compiler to measure the runtime performance benefits. The first optimization is performed at runtime. It is based on the idea that the dynamic type of a reference barely changes at runtime. Therefore, if the dynamic type is cached, we can generate specialized code for that precise type. When there is a cache hit, the program will perform close to its statically typed version. For this purpose, we have used the DLR of the .Net framework to optimize all the existing hybrid typing languages for that platform. The optimizations are provided as a binary optimization tool, and included in an existing compiler. Performance benefits range from 44.6% to 11 factors. The second optimization is aimed at improving the performance of dynamic variables holding different types in the same scope. We have defined a modification of the classical SSA transformations to improve the task of type inference. Due to the proposed algorithms, we infer one single type for each local variable. This makes the generated code to be significantly faster, since type casts are avoided. When a refer- ence has a flow sensitive type, we use union types and nested runtime type inspections. Since we avoid the use of reflection, execution time is significantly faster than existing approaches. Average performance improvements range from 6.4 to 21.7 factors. Besides, the optimized code consumes fewer memory resources. The third optimization is focused on the improvement of multiple dispatch for object-oriented languages. One typical way of providing multiple dispatch is resolving method overload at runtime: depend- ing on the dynamic types of the arguments, the appropriate method implementation is selected. We propose a multiple dispatch mech- anism based on the type information of the arguments gathered by the compiler. With this information, a particular specialization of the method is generated, making the code to run significantly faster than reflection or nested type inspection. This approach has other benefits such as better maintainability and readability, lower code size, pa- rameter generalization, early type error detection and fewer memory resources. Keywords Dynamic typing, runtime performance, optimization, hy- brid dynamic and static typing, Dynamic Language Run- time, Static Single Assignment, SSA Form, multiple dis- patch, multi-method, union types, reflection, StaDyn, .Net Contents Contents iv List of Figures vi 1 Introduction1 1.1 Motivation . .1 1.2 Contributions . .3 1.3 Structure of the document . .4 2 Related Work5 2.1 The StaDyn programming language . .5 2.1.1 Type inference . .6 2.1.2 Duck typing . .6 2.1.3 Dynamic and static typing . .8 2.1.4 Implicitly typed parameters . .9 2.1.5 Implicitly typed attributes . 10 2.1.6 Alias analysis for concrete type evolution . 11 2.1.7 Implementation . 11 2.2 Hybrid static and dynamic typing languages . 12 2.3 Optimizations of dynamically typed virtual machines . 15 2.4 Optimizations based on the SSA form . 16 2.5 Multiple dispatch (multi-methods) . 17 3 Optimizing Dynamically Typed Operations with a Type Cache 20 3.1 The Dynamic Language Runtime . 21 3.2 Optimization of .Net hybrid typing languages . 22 3.2.1 VB optimizations . 24 3.2.2 Boo optimizations . 29 3.2.3 Cobra optimizations . 29 3.2.4 Fantom optimizations . 29 3.2.5 StaDyn optimizations . 33 3.3 Implementation . 33 3.3.1 Binary program transformation . 33 3.3.2 Compiler optimization phase . 34 3.4 Evaluation . 35 3.4.1 Methodology . 35 3.4.1.1 Selected languages . 36 3.4.1.2 Selected benchmarks . 36 iv Contents 3.4.1.3 Data analysis . 37 3.4.1.4 Data measurement . 39 3.4.2 Start-up performance . 39 3.4.2.1 Discussion . 40 3.4.3 Steady-State performance . 41 3.4.3.1 Discussion . 41 3.4.4 Memory consumption . 42 3.4.4.1 Discussion . 43 4 Optimizations based on the SSA form 45 4.1 SSA form . 47 4.2 SSA form to allow multiple types in the same scope . 48 4.2.1 Basic blocks . 49 4.2.2 Conditionals statements . 51 4.2.3 Loop statements . 52 4.2.4 Union types . 53 4.2.5 Implementation . 55 4.3 Evaluation . 56 4.3.1 Methodology . 56 4.3.2 Start-up performance . 57 4.3.3 Steady-state performance . 59 4.3.4 Memory consumption . 60 4.3.5 Compilation time . 60 5 Optimizing Multimethods with Static Type Inference 62 5.1 Existing approaches . 63 5.1.1 The Visitor design pattern . 63 5.1.2 Runtime type inspection . 65 5.1.3 Reflection . 66 5.1.4 Hybrid typing . 67 5.2 Static type checking of dynamically typed code . 68 5.2.1 Method specialization . 69 5.3 Evaluation . 71 5.3.1 Methodology . 71 5.3.2 Runtime performance . 72 5.3.3 Memory consumption . 77 6 Conclusions 79 6.1 Future Work . 80 A Evaluation data of the DLR optimizations 81 B Evaluation data of the SSA optimizations 85 C Evaluation data for the multiple dispatch optimizations 89 D Publications 95 References 97 v List of Figures 1.1 Hybrid static and dynamic typing example in C#. .2 2.1 Type inference of var and dynamic references. .6 2.2 Static duck typing. .7 2.3 Static var reference. .8 2.4 Implicitly typed parameters. .9 2.5 Implicitly typed attributes. 10 2.6 Alias analysis. 11 3.1 Example VB program with (right-hand side) and without (left- hand side) DLR optimizations. 21 3.2 Architecture of the two optimization approaches. 24 3.3 Transformation of common expressions. 25 3.4 Transformation of common type conversions. 26 3.5 Transformation of indexing operations. 27 3.6 Transformation of method invocation and field access. 28 3.7 Optimization of Boo basic expressions and type conversions. 30 3.8 Optimization of Boo invocations, indexing and member access. 31 3.9 Cobra optimization rules. 32 3.10 Fantom optimization rules. 33 3.11 StaDyn optimization rules. 34 3.12 Class diagram of the binary program transformation tool. 35 3.13 Start-up performance improvement for Pybench. 40 3.14 Start-up performance improvement. 41 3.15 Steady-state performance improvement. 42 3.16 Memory consumption increase. 43 4.1 The dynamically typed reference number holds different types in the same scope. 45 4.2 Type conversions must be added when number is declared as object. 46 4.3 A SSA transformation of the code in Figure 4.1........... 46 4.4 CFG for the code in Figure 4.5 (left) and its SSA form (right). 47 4.5 An iterative Fibonacci function using dynamically typed variables. 48 4.6 SSA transformation of a sequence of statements. 50 4.7 SSA transformation of statements. 50 4.8 SSA transformation of expressions. 50 4.9 Original CFG of an if-else statement (left) and its SSA form (right). 51 vi List of Figures 4.10 SSA transformation of if-else statements. 52 4.11 Original CFG of a while statement (left), and intermediate SSA representation (middle) and its final SSA form (right). 53 4.12 SSA transformation of while statements. 54 4.13 A simplification of the StaDyn compiler architecture [1]. 55 4.14 Type inference of the SSA form. 55 4.15 Start-up performance of Pybench, relative to StaDyn without SSA. 58 4.16 Start-up performance of all the benchmarks, relative to StaDyn without SSA. 58 4.17 Steady-state performance of all the benchmarks, relative to C#.
Recommended publications
  • Lap Around the .NET Framework 4
    Lap Around the .NET Framework 4 Marc Schweigert ([email protected]) Principal Developer Evangelist DPE US Federal Government Team http://blogs.msdn.com/devkeydet http://twitter.com/devkeydet .NET Framework 4.0 User Interface Services Data Access ASP.NET Windows Windows (WebForms, Entity Presentation Data Services Communication ADO.NET MVC, Dynamic Framework Foundation Foundation Data) Windows WinForms Workflow LINQ to SQL Foundation Core Managed Dynamic Parallel Base Class Extensibility LINQ Languages Language Extensions Library Framework Runtime Common Language Runtime ASP.NET MVC 1.0 (Model View Controller) A new Web Application Project type Simply an option Not a replacement for WebForms Builds on top ASP.NET Manual vs. Automatic Transmission Supports a clear separation of concerns Supports testability Supports “close to the metal” programming experience ASP.NET MVC 2 Visual Studio 2010 Included Visual Studio 2008 (Service Pack 1) Download Both versions built against .NET 3.5 What’s New in MVC 2? Better Separation of Concerns (Maintainability) Html.RenderAction() Areas Easier Validation (Maintainability/Productivity) Data Annotations Client Validation Helper Improvements (Maintainability/Productivity) Strongly-Typed Helpers Templated Helpers ASP.NET 4 Web Forms? Support for SEO with URL Routing Cleaner HTML Client ID improvements ViewState improvements Dynamic Data Improvements Chart Controls Productivity and Extensibility Rich Client Ajax supports both MVC & Web Forms WPF 4 Calendar, Data Grid, DatePicker Ribbon (separate download)
    [Show full text]
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Expression Trees 1 Dynamic Language Runtime Overview 5 Creating and Using Dynamic Objects 9 Early and Late Binding 17 Execute Ex
    Expression Trees 1 Dynamic Language Runtime Overview 5 Creating and Using Dynamic Objects 9 Early and Late Binding 17 Execute Expression Trees 19 Modify Expression Trees 21 Use Expression Trees to Build Dynamic Queries 23 Debugging Expression Trees 26 Expression Trees (Visual Basic) https://msdn.microsoft.com/en-us/library/mt654260(d=printer).aspx Expression Trees (Visual Basic) Visual Studio 2015 Expression trees represent code in a tree-like data structure, where each node is an expression, for example, a method call or a binary operation such as x < y . You can compile and run code represented by expression trees. This enables dynamic modification of executable code, the execution of LINQ queries in various databases, and the creation of dynamic queries. For more information about expression trees in LINQ, see How to: Use Expression Trees to Build Dynamic Queries (Visual Basic) . Expression trees are also used in the dynamic language runtime (DLR) to provide interoperability between dynamic languages and the .NET Framework and to enable compiler writers to emit expression trees instead of Microsoft intermediate language (MSIL). For more information about the DLR, see Dynamic Language Runtime Overview . You can have the C# or Visual Basic compiler create an expression tree for you based on an anonymous lambda expression, or you can create expression trees manually by using the System.Linq.Expressions namespace. Creating Expression Trees from Lambda Expressions When a lambda expression is assigned to a variable of type Expression(Of TDelegate) , the compiler emits code to build an expression tree that represents the lambda expression. The Visual Basic compiler can generate expression trees only from expression lambdas (or single-line lambdas).
    [Show full text]
  • Ironpython Und Die Dynamic Language Runtime (DLR) Softwareentwicklung Mit Python Auf Der Microsoft Windows Plattform
    IronPython und die Dynamic Language Runtime (DLR) Softwareentwicklung mit Python auf der Microsoft Windows Plattform Klaus Rohe ([email protected]) Microsoft Deutschland GmbH Einige Anmerkungen • Kein Python Tutorial: • Es werden einige Unterschiede von Python zu C# / Java dargestellt • Die Eigenschaften, Beispiele und Demos beziehen sich auf die Version IronPython 2.0 Beta 4. Die endgültig freigegebene Version von IronPython 2.0 kann andere Eigenschaften besitzen und sich anders verhalten. Herbstcampus 2008 – Titel des Vortrags 2 Agenda • Python • IronPython & die Dynamic Language Runtime • Benutzung von .NET Bibliotheken in IronPython • ADO.NET • WPF • Einbetten von IronPython in Applikationen • Interoperabilität • IronPython & Cpython • Interoperabilität CPython - .NET Herbstcampus 2008 – Titel des Vortrags 3 Historie von Python • Anfang der 1990er Jahre von Guido van Rossum am Zentrum für Mathematik und Informatik Amsterdam als Nachfolger für die Lehrsprache ABC entwickelt • Wurde ursprünglich für das verteilte Betriebssystem Amoeba entwickelt: http://www.cs.vu.nl/pub/amoeba/ • Der Name der Sprache bezieht sich auf die britische Komiker Gruppe Monty Python Herbstcampus 2008 – Titel des Vortrags 4 Charakterisierung von Python (1) • Python-Programm wird interpretiert • Unterstützt mehrere Programmierparadigmen: • Prozedural • Objektorientiert • Funktional • Klare, einfache Syntax • Portabel, verfügbar auf allen Plattformen mit C-Compiler • Windows, Mac OS, UNIX, LINUX, … • Leicht erweiterbar mit C/C++ Bibliotheken • Z. B. Bibliothek
    [Show full text]
  • A Multi-Programming-Language, Multi-Context Framework Designed for Computer Science Education Douglas Blank1, Jennifer S
    Bryn Mawr College Scholarship, Research, and Creative Work at Bryn Mawr College Computer Science Faculty Research and Computer Science Scholarship 2012 Calico: a multi-programming-language, multi- context framework designed for computer science education Doug Blank Bryn Mawr College, [email protected] Jennifer S. Kay James B. Marshall Keith O'Hara Mark Russo Let us know how access to this document benefits ouy . Follow this and additional works at: http://repository.brynmawr.edu/compsci_pubs Part of the Computer Sciences Commons Custom Citation Douglas Blank, Jennifer S. Kay, James B. Marshall, Keith O'Hara, and Mark Russo. Calico: A Multi-Programming-Language, Multi- Context Framework Designed for Computer Science Education. (2012). SIGCSE 2012 (Raleigh, NC). This paper is posted at Scholarship, Research, and Creative Work at Bryn Mawr College. http://repository.brynmawr.edu/compsci_pubs/53 For more information, please contact [email protected]. To appear in the Proceedings of the 43rd ACM Technical Symposium on Computer Science Education, SIGCSE 2012 Calico: A Multi-Programming-Language, Multi-Context Framework Designed for Computer Science Education Douglas Blank1, Jennifer S. Kay2, James B. Marshall3, Keith O'Hara4, and Mark Russo1 1Computer Science 2Computer Science 3Computer Science 4Computer Science Department Department Department Program Bryn Mawr College Rowan University Sarah Lawrence College Bard College Bryn Mawr, PA (USA) Glassboro, NJ (USA) Bronxville, NY (USA) Annandale-on-Hudson, NY (1) 610-526-6501 (1) 856-256-4593 (1) 914-395-2673 (1) 845-752-2359 [email protected] [email protected] [email protected] [email protected] ABSTRACT these contexts are often tied to a specific programming environ- The Calico project is a multi-language, multi-context program- ment, which limits their availability to only those willing to work ming framework and learning environment for computing educa- in that programming environment.
    [Show full text]
  • Pro DLR in .NET 4
    Pro DLR in .NET 4 Chaur Wu Pro DLR in .NET 4 Copyright © 2010 by Chaur Wu All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN 978-1-4302-3066-3 ISBN 978-1-4302-3067-0 (eBook) Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Jonathan Gennick Technical Reviewer: Scott Isaacs Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Jennifer L. Blackwell Copy Editor: Sharon Terdeman Compositor: Bytheway Publishing Services Indexer: Brenda Miller Artist: Integra Software Services Pvt.
    [Show full text]
  • Data Driven Software Engineering Track
    Judith Bishop Microsoft Research 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 C# 1.0 C# 2.0 C# 3.0 C#4.0 Spec#1.0 Spec# Code CodeCont .5 1.0.6 Contracts racts 1.4 Java 1.5 F# Java 6 F# in VS F# C Ruby on LINQ Python Rails 3.0 Firefox 2 Firefox 3 IE6 Safari 1 IE7 Safari 4 IE8 Safari 5 Windows Windows DLR beta Windows DLR 1.0 XP Vista 7 .NET Rotor Mono 1.0 .NET 2 Rotor 2.0 .NET 3.5 .Net 4.0 Mac OS Ubuntu Mac OS Mac OSX Mac OS X Linux X Intel Leopard XSnow. VS 2003 VS 2005 VS2008 VS2010 Eclipse Eclipse Eclipse 1.0 3.0 3.6 Advantages Uses • Rapid feedback loop (REPL) • Scripting applications • Simultaneous top-down and • Building web sites bottom-up development • Test harnesses • Rapid refactoring and code • Server farm maintenance changing • One-off utilities or data • Easy glue code crunching C# 1.0 2001 C# 2.0 2005 C# 3.0 2007 C# 4.0 2009 structs generics implicit typing dynamic lookup properties anonymous anonymous types named and foreach loops methods object and array optional autoboxing iterators initializers arguments delegates and partial types extension COM interop events nullable types methods, variance indexers generic lambda operator delegates expressions overloading query expressions enumerated types (LINQ) with IO in, out and ref parameters formatted output API Serializable std generic Reflection delegates The dynamic language runtime (DLR) is a runtime environment that adds a set of services for dynamic languages – and dynamic featues of statically typed languages – to the common language runtime (CLR) • Dynamic Lookup • Calls, accesses and invocations bypass static type checking and get resolved at runtime • Named, default and optional parameters • COM interop • Variance • Extends type checking in generic types • E.g.
    [Show full text]
  • Metaprogramming in .NET by Kevin Hazzard Jason Bock
    S AMPLE CHAPTER in .NET Kevin Hazzard Jason Bock FOREWORD BY Rockford Lhotka MANNING Metaprogramming in .NET by Kevin Hazzard Jason Bock Chapter 1 Copyright 2013 Manning Publications brief contents PART 1DEMYSTIFYING METAPROGRAMMING ..............................1 1 ■ Metaprogramming concepts 3 2 ■ Exploring code and metadata with reflection 41 PART 2TECHNIQUES FOR GENERATING CODE ..........................63 3 ■ The Text Template Transformation Toolkit (T4) 65 4 ■ Generating code with the CodeDOM 101 5 ■ Generating code with Reflection.Emit 139 6 ■ Generating code with expressions 171 7 ■ Generating code with IL rewriting 199 PART 3LANGUAGES AND TOOLS ............................................221 8 ■ The Dynamic Language Runtime 223 9 ■ Languages and tools 267 10 ■ Managing the .NET Compiler 287 v Metaprogramming concepts In this chapter ■ Defining metaprogramming ■ Exploring examples of metaprogramming The basic principles of object-oriented programming (OOP) are understood by most software developers these days. For example, you probably understand how encapsulation and implementation-hiding can increase the cohesion of classes. Languages like C# and Visual Basic are excellent for creating so-called coarsely grained types because they expose simple features for grouping and hiding both code and data. You can use cohesive types to raise the abstraction level across a system, which allows for loose coupling to occur. Systems that enjoy loose cou- pling at the top level are much easier to maintain because each subsystem isn’t as dependent on the others as they could be in a poor design. Those benefits are realized at the lower levels, too, typically through lowered complexity and greater reusability of classes. In figure 1.1, which of the two systems depicted would likely be easier to modify? Without knowing what the gray circles represent, most developers would pick the diagram on the right as the better one.
    [Show full text]
  • Discovering Ironpython
    PART I Introducing IronPython ⊲⊲ CHAPTER 1: Discovering IronPython ⊲⊲ CHAPTER 2: Understanding the IronPython Basics COPYRIGHTED MATERIAL 548592c01.indd 1 2/24/10 12:47:07 PM 548592c01.indd 2 2/24/10 12:47:08 PM 1 Discovering IronPython WHAT’S IN THIS CHAPTER? ➤➤ Understanding why you want to add IronPython to your developer toolbox ➤➤ Obtaining and installing IronPython on your machine ➤➤ Understanding some underlying basics of how IronPython works ➤➤ Using IronPython at the console and within a window ➤➤ Designing and building a simple application IronPython: It sounds like some kind of metal snake infesting your computer, but it isn’t. IronPython is the .NET version of the open source Python language (http://www .python.org/). Python is a dynamic language that can greatly enhance your programming experience, help you create applications in less time, and make the applications you create significantly more responsive to user needs. Of course, you’ve heard these promises before from other languages. This chapter helps you understand how IronPython delivers on these promises in specific situations. The smart developer soon learns that every language serves specific needs and might not work well in others. So this chapter isn’t here to blow smoke at you — ​once you complete it, you’ll understand the strengths and weaknesses of IronPython. Of course, you’ll need to obtain a copy of IronPython before you can use it because Visual Studio doesn’t include IronPython as part of the default installation. This chapter helps you get IronPython installed on your system and tells you about some options you may want to install as well.
    [Show full text]
  • NET Hacking & In-Memory Malware
    .NET Hacking & In-Memory Malware Shawn Edwards Shawn Edwards Cyber Adversarial Engineer The MITRE Corporation Hacker Maker Learner Take stuff apart. Change it. Put Motivated by an incessant Devoted to a continuous effort it back together. desire to create and craft. of learning and sharing knowledge. Red teamer. Adversary Numerous personal and emulator. professional projects. B.S. in Computer Science. Adversary Emulation @ MITRE • Red teaming, but specific threat actors • Use open-source knowledge of their TTPs to emulate their behavior and operations • Ensures techniques are accurate to real world • ATT&CK (Adversarial Tactics Techniques and Common Knowledge) • Public wiki of real-world adversary TTPs, software, and groups • CALDERA • Modular Automated Adversary Emulation framework Adversary Emulation @ MITRE • ATT&CK • Adversarial Tactics Techniques and Common Knowledge • Public wiki of real-world adversary TTPs, software, and groups • Lets blue team and red team speak in the same language • CALDERA • Modular Automated Adversary Emulation framework • Adversary Mode: • AI-driven “red team in a box” • Atomic Mode: • Define Adversaries, give them abilities, run operations. Customize everything at will. In-Memory Malware • Is not new • Process Injection has been around for a long time • Typically thought of as advanced tradecraft; not really • Surged in popularity recently • Made easier by open-source or commercial red team tools • For this talk, only discuss Windows malware • When relevant, will include the ATT&CK Technique ID In-Memory
    [Show full text]
  • The Microsoft .NET Framework Was from the Beginning Designed to Support Broad Range of Languages on a Common Language Runtime (CLR)
    The Microsoft .NET Framework was from the beginning designed to support broad range of languages on a Common Language Runtime (CLR). CLR provides shared services such as garbage collection, JIT and tools integration. The other benefit is that these languages can work together and use libraries written in any of them as well as .NET Base class library (BCL). The CLR didn’t have the support for dynamic languages. Their dynamic nature makes the compilation uneasy and places high demands on the language runtime. Unlike static languages as C# which don’t require runtime support other than CLR itself. How difficult was it to make the dynamic language on .NET can be seen in the open-source implementation of PHP language on .NET called Phalanger. Its code is really complex and hard to survey. This is a serious problem for an open-source project, because it’s hard to contribute. The new Dynamic Language Runtime (DLR) makes a difference. It adds a lot of support for dynamic languages on .NET, that makes implementing the dynamic languages much easier and it also enables the interoperability between the dynamic languages built on DLR and standard static languages on .NET. This work focuses on features of PHP dynamic language and discusses how they can be implemented in DLR. A part of this work is a pilot implementation of PHP language on DLR; the target of this implementation is to prove some new concepts, find advantages and disadvantages that DLR brings and serves as an example for implementing the dynamic language on DLR..
    [Show full text]
  • Warum Dynamische Sprachen ?? Wo Würde Ich Persönlich Sie Verwenden, Wo Nicht ;-)
    { Helden brauchen weniger } Frank Fischer Manager Evangelism and Marketing http://blogs.msdn.com/frankfi Microsoft Deutschland GmbH Jim Hugunin 100K 80K 60K 101K 90K 40K 80K 46K 50K 36K20K 0K Python Python Python IronPython IronPython IronPython 2.1 2.3 2.5 0.1 1.0 2.0alpha1 Jim Hugunin Principal Architect Microsoft Corp. Eine Geschichte zum Beginn… (hatten wir gerade) Was sind „dynamische Sprachen“ ?? Der Versuch einer Definition Warum dynamische Sprachen ?? Wo würde ich persönlich sie verwenden, wo nicht ;-) Was hat Microsoft damit zu tun?? Eine Geschichte zum Beginn… (hatten wir gerade) Was sind „dynamische Sprachen“ ?? Der Versuch einer Definition Warum dynamische Sprachen ?? Wo würde ich persönlich sie verwenden, wo nicht ;-) Was hat Microsoft damit zu tun?? Dynamic programming language is a term used broadly in computer science to describe a class of high level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution. These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them. Dynamic languages and dynamic typing are not identical concepts, and a dynamic language need not be dynamically typed, though many dynamic languages are dynamically typed. http://en.wikipedia.org/wiki/Dynamic_programming_language
    [Show full text]