Presentation is loading. Please wait.

Presentation is loading. Please wait.

Research in Compilers and How it Relates to Software Engineering Part III: Relation to SE Tomofumi Yuki EJCP 2015 June 22, Nancy.

Similar presentations


Presentation on theme: "Research in Compilers and How it Relates to Software Engineering Part III: Relation to SE Tomofumi Yuki EJCP 2015 June 22, Nancy."— Presentation transcript:

1 Research in Compilers and How it Relates to Software Engineering Part III: Relation to SE Tomofumi Yuki EJCP 2015 June 22, Nancy

2 What is Software Engineering? Can you describe SE? Engineering applied to software What is engineering? Goals of SE easy to understand easy to modify easy to debug with little cost in performance 2 EJCP 2015, June 22, Nancy

3 The Problem Building software pyramids EJCP 2015, June 22, Nancy 3

4 If software developers built the pyramids … EJCP 2015, June 22, Nancy 4

5 Software Engineering Programmer s Software Engineers SE Researchers no goto class hierarchy generics design patterns development cycles UML specifications generative methods Application (Local) Application (Local) Application (Global) Application (Global) Develop/Invent Techniques Develop/Invent Techniques structured prog. software coverage fault injection product-lines find cause of failure 5 compiler techniques compiler techniques EJCP 2015, June 22, Nancy 5

6 Quick and Dirty View Compiler is all about abstraction Software Engineering is all about abstraction  Compiler = Software Engineering it is a stretch (of course) Programming Languages probably a better intersection how to better write in a language how to design a language to ease programming 6 EJCP 2015, June 22, Nancy

7 Example 1: Object-Orientation Initial motivation was modularity More SE developments later on design patterns polymorphism 7 op1 a, b, c op2 a, d, e op3 f, c, e... op1 a, b, c op2 a, d, e op3 f, c, e... main() {... foo(..);... bar(..);... } main() {... foo(..);... bar(..);... } class A {... foo()... } class B {...} class A {... foo()... } class B {...} EJCP 2015, June 22, Nancy

8 Example 2: Deadlock Detection Many approaches check if a problem can deadlock ensure its absence by language design ensure its absence by coding principles catch and resolve at run-time Is it SE problem or PL problem? papers appear in both domains 8 EJCP 2015, June 22, Nancy

9 Today’s Focus: MDE Specific instance where compiler and SE meet Model Driven Engineering Key Connection 9 EJCP 2015, June 22, Nancy Model Instance = Program Instance Model = Grammar Many Tools and Problems are Shared

10 MDE: A Solution Goal of MDE: reducing accidental complexities bridging wide abstraction gaps Key Element: support rigorous transformation of abstractions to software implementations MDE is concerned with developing software tools to support the work of software developers 10 MDE helps make a software developer a software engineer EJCP 2015, June 22, Nancy

11 What is a Model? A description of an aspect of a software-based system that may or may not exist. A model is created to serve one or more purposes. 11 EJCP 2015, June 22, Nancy

12 Early focus of MDE Models for documentation/communication Foundation: early work on CASE Models for generating implementations OMG’s work on UML and MDA Model Transformations Software development viewed as a transformative process Key enablers of MDA 12 EJCP 2015, June 22, Nancy

13 MDE Example 1 Discuss the desired software with model stay high-level easy to visualize model Transform to another model fill some details check for properties Generate code (skeleton) implement the details EJCP 2015, June 22, Nancy 13 Model Model’ Code

14 Evolution of MDE Breathing life into models Models as analyzable artifacts Foundation from formal specification Models for managing runtime behavior models@run.time Supporting domain-specific software development Applying MDE technologies in other CS domains 14 EJCP 2015, June 22, Nancy

15 MDE Example 2 There exists a software corresponding model Develop another one similar but different How to maximize reuse productivity reliability... EJCP 2015, June 22, Nancy 15 Model A Tool A Model B Tool B

16 Tools for MDE Mapping concrete syntax parser generation graphical language Constraint checking check if rules of the model is satisfied more advanced check (e.g., cycles) Code generation from model EJCP 2015, June 22, Nancy 16

17 Optimizing Compilers Goal: generate “efficient” code Execution time Energy consumption Code size Wide range of optimizations Register allocation Dead code elimination Automatic parallelization Run-time optimizations 17 EJCP 2015, June 22, Nancy

18 Optimizing Compiler Research Prototype implementations “Proof of Concept” Evaluation Compilers are complicated pieces of software Need for rapid development Development spans generations of students Performance of compiler prototype not critical 18 EJCP 2015, June 22, Nancy

19 Optimizing Compiler Examples High-level flow of two research compilers: 19 1.Parse source language 2.Transform intermediate representations (IRs) for efficiency. May take domain specific knowledge as additional inputs. 3.Output code or binary EJCP 2015, June 22, Nancy

20 Research Compiler Challenges Maintainable and Sustainable Code Developers may not have good SE background Structural Validity of IR Is the IR consistent after parsing/transformation? Complex Querying of IR Find where to apply transformations Interfacing with External Tools Avoid as much re-implementation as possible 20 EJCP 2015, June 22, Nancy

21 More Challenges Semantics Preserving Transformations Compilers should not alter semantics Use of Domain Specific Knowledge How to incorporate domain specific knowledge Code Generation Generate code for different target architecture programming model 21 EJCP 2015, June 22, Nancy

22 Bridging with MDE View compiler IRs as models 22 DSLs and Tooling Model Transformations and Analyses Code Generation EJCP 2015, June 22, Nancy

23 Challenges Analyses and Manipulation of IRs 23 Structural Validation Complex Querying and Transformation s EJCP 2015, June 22, Nancy

24 Challenges and MDE Solutions Analyses and Manipulation of IRs 24 Structural Validation Complex Querying and Transformation s Structural Properties on models (conformity) OCL constraints Structural Properties on models (conformity) OCL constraints OCL queries M2M tools Rewriting rules OCL queries M2M tools Rewriting rules EJCP 2015, June 22, Nancy

25 Challenges Domain specific knowledge is heavily utilized 25 Domain Specific Knowledge Representation EJCP 2015, June 22, Nancy

26 Challenges and MDE Solutions Domain specific knowledge is heavily utilized 26 Domain Specific Knowledge Representation MDE-based DSLs Generative approaches (editor, parser) MDE-based DSLs Generative approaches (editor, parser) EJCP 2015, June 22, Nancy

27 Challenges Code generation and external tools 27 Domain Specific Knowledge as additional inputs Code Generation Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) Code Generation Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) EJCP 2015, June 22, Nancy

28 Challenges and MDE Solutions Code generation and external tools 28 Domain Specific Knowledge as additional inputs Code Generation Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) Code Generation Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) Use of External Tools (term rewriting, ML, LP, CSP, …) M2T tools (Xpand/Xtend) Metatools Metamodel instrumentation Defining new generative tools Metatools Metamodel instrumentation Defining new generative tools EJCP 2015, June 22, Nancy

29 Limitations of MDE MDE does not let you do something “new” It may take more time, but you can do it MDE does not help if your idea isn’t right You may have your prototype in 2 weeks but, it does not help you get good numbers 29 EJCP 2015, June 22, Nancy

30 Some Remaining Challenges Model transformation verification and testing Property preserving model transformations Coping with a multitude of DSLs Avoid defining and tooling of a DSL from scratch Inter-language reasoning Scalability Compilers handle large models Maturity of MDE tools 30 EJCP 2015, June 22, Nancy

31 Perspectives MDE can learn from optimizing compilers in: Knowledge of the platform (PDM) Efficiency and scalability culture Anticipate use of DSLs to grow Thus, every software engineer will have to deal with compilation chains for DSLs 31 EJCP 2015, June 22, Nancy

32 Main Message Compiler may not be so far away from you! 3 years is short, but don’t just look at your tiny little domain many fields are closely connected of course, sometimes it’s good to focus 32 EJCP 2015, June 22, Nancy

33 Acknowledgements Some slides in this talk was taken from my a talk for our paper done by Robert France Benoit Combemale Steven Derrien Sanjay Rajopadhye Clement Guy Antoine Floch EJCP 2015, June 22, Nancy 33


Download ppt "Research in Compilers and How it Relates to Software Engineering Part III: Relation to SE Tomofumi Yuki EJCP 2015 June 22, Nancy."

Similar presentations


Ads by Google