SlideShare una empresa de Scribd logo
1 de 18
by Sina Madani
September 2016
 A software framework which enables cross-platform
(asynchronous) communication via Remote Procedure Call
 Does this through an Interface Definition Language (IDL)
 Define services and the functions provided by these services
 Supports complex data types (struct, list, map etc.)
MyCalculator.thrift
i32 add(i32 num1, i32 num2);
i32 subtract(i32 num1, i32 num2);
i64 multiply(i32 num1, i32 num2);
double divide(i32 num1, i32 num2);
Compiler
thrift –-gen [language]
“MyCalculator.thrift”
MyCalculator.java
Client code
Server code
MyCalculator.py
Client code
Server code
MyCalculator.cpp
Client code
Server code
 Re-implement (a subset of) Thrift’s compiler using MDE tools
– more specifically, the parser + 2 output languages
 Evaluate the model-driven approach and current MDE
technologies for implementing intermediate languages
 Compare to existing implementation to observe benefits and
drawbacks of the MDE approach
 No reports on replicating existing compilers using MDE
 Wide variance in productivity gains
 MDE adoption – good tools are high priority, but not the only
concern – “necessary but insufficient”
 Benefits: improved communication and transparency of design
.thrift file
flex
(Lexer)
Bison
(Parser)
Semantic
Validation
Code
generation
Output files
 C++ based (a primarily systems programming language)
 Low-level parsing tools (manually build AST and types)
 Validation performed at various stages
 Code generation difficult to read (lots of functions)
 Java-based tools
 Eclipse Modelling Framework (EMF)
 Xtext for parsing
 Epsilon for validation and code generation
 Solution centred around the IDL’s (meta)model
 Define the grammar using Xtext
 Self-documenting EBNF notation
 Automatically generates Ecore metamodel
 Lexing and parsing handled automatically
 Editor support with syntactic validation and highlighting
 Context-free grammar cannot capture language semantics
 Need to ensure semantics and scoping are valid
 For example, this is syntactically valid, but does it make sense?
const list<i32> myNumberz = “a string!”;
 Use Epsilon Validation Language to express these constraints
 Epsilon Generation Language (EGL) – template-based M2T
 Static sections output verbatim
 Dynamic sections expressed in Epsilon Object Language (EOL)
 Can use operations, imports, extended properties etc.
 EGX invokes EGL templates with parameters
 Took a TDD approach to implementing code generators
 Various complex Thrift IDL files available on website
 Auto-generated editor validates syntax
 Eclipse file comparison editor to highlight output differences
 Automated tests using JUnit (compare as strings or file size)
Stage/Implementation C++ (existing) EMF (model-driven)
Language definition
(parsing & validation)
3419 (105 KB) 447 (14 KB)
Language-agnostic code 712 (22KB) 1036 (26 KB)
Java generator 5129 (187 KB) 2224 (73 KB)
Ruby generator 1231 (40 KB) 422 (14 KB)
Overall total >10491 (~395 KB) 4149 (~128 KB)
 More concise – less code to do (more or less) the same job
 Reduced coupling and higher cohesion
 Higher level of abstraction – focus on what actually matters
 Easier to understand what’s happening at each stage
 Arguably more modifiable and easier to maintain as a result
 Greater dependence on tools and libraries (EMF, Xtext, Epsilon)
 Performance is significantly worse due to the overhead of these
tools compared to the “close-to-metal” C++ solution
 Troubleshooting and long-term support (skills, complexity of
underlying MDE technologies...)
 First complete re-implementation using MDE technologies of
such a complex system
 MDE solution is significantly more concise overall
 Main benefits come in the form of readability, cohesion and,
arguably, a more intuitive workflow
 Need to formally evaluate subjective aspects - e.g. readability,
modifiability, understandability, maintainability...
 Would the results be similar for other IDL frameworks?
 Thank you for listening!
.thrift IDL file
“Interpreter”
Grammar
definition file
Lexer/Parser
has a
Metamodel
makes a
conforms to
Validator
Model
elements
Constraints
uses
Code generator
Templates
Additional
files
Model
Model
uses
Output files in
target language
if no
constraints
are violated
Headers / imports
Regular Expressions Action to take
(code block)
Additional code
Generated parser
Output
directly
Output
directly
Thrift C++ compiler
flex and Bison

Más contenido relacionado

La actualidad más candente

On the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF ModelsOn the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF Models
Filip Krikava
 
Language processor
Language processorLanguage processor
Language processor
Abha Damani
 
Language processors
Language processorsLanguage processors
Language processors
eShikshak
 
Computer Systems Lab Overview
Computer Systems Lab OverviewComputer Systems Lab Overview
Computer Systems Lab Overview
butest
 

La actualidad más candente (20)

Compiler construction tools
Compiler construction toolsCompiler construction tools
Compiler construction tools
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
 
On the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF ModelsOn the Use of an Internal DSL for Enriching EMF Models
On the Use of an Internal DSL for Enriching EMF Models
 
Learning New Semi-Supervised Deep Auto-encoder Features for Statistical Machi...
Learning New Semi-Supervised Deep Auto-encoder Features for Statistical Machi...Learning New Semi-Supervised Deep Auto-encoder Features for Statistical Machi...
Learning New Semi-Supervised Deep Auto-encoder Features for Statistical Machi...
 
C Sharp Jn
C Sharp JnC Sharp Jn
C Sharp Jn
 
Language processor
Language processorLanguage processor
Language processor
 
Language processors
Language processorsLanguage processors
Language processors
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
 
Compiler design
Compiler designCompiler design
Compiler design
 
F# and SignalR for a FastWeb
F# and SignalR for a FastWebF# and SignalR for a FastWeb
F# and SignalR for a FastWeb
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
Interoperability
InteroperabilityInteroperability
Interoperability
 
Software Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionSoftware Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesion
 
Computer Systems Lab Overview
Computer Systems Lab OverviewComputer Systems Lab Overview
Computer Systems Lab Overview
 
C- language Lecture 4
C- language Lecture 4C- language Lecture 4
C- language Lecture 4
 
Unit 2 ppt
Unit 2 pptUnit 2 ppt
Unit 2 ppt
 
Feedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLPFeedback on Part 1 of the CSLP
Feedback on Part 1 of the CSLP
 
Java chapter 3
Java   chapter 3Java   chapter 3
Java chapter 3
 
OCL'16 slides: Models from Code or Code as a Model?
OCL'16 slides: Models from Code or Code as a Model?OCL'16 slides: Models from Code or Code as a Model?
OCL'16 slides: Models from Code or Code as a Model?
 
Design Pattern lecture 3
Design Pattern lecture 3Design Pattern lecture 3
Design Pattern lecture 3
 

Destacado

Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linaro
 
BUD17-218: Scheduler Load tracking update and improvement
BUD17-218: Scheduler Load tracking update and improvement BUD17-218: Scheduler Load tracking update and improvement
BUD17-218: Scheduler Load tracking update and improvement
Linaro
 

Destacado (18)

A brief tour of modern Java
A brief tour of modern JavaA brief tour of modern Java
A brief tour of modern Java
 
Java library synopsis
Java library synopsisJava library synopsis
Java library synopsis
 
Thesis: Slicing of Java Programs using the Soot Framework (2006)
Thesis:  Slicing of Java Programs using the Soot Framework (2006) Thesis:  Slicing of Java Programs using the Soot Framework (2006)
Thesis: Slicing of Java Programs using the Soot Framework (2006)
 
Introduction to Golang final
Introduction to Golang final Introduction to Golang final
Introduction to Golang final
 
Singleton class in Java
Singleton class in JavaSingleton class in Java
Singleton class in Java
 
Java SE 8 library design
Java SE 8 library designJava SE 8 library design
Java SE 8 library design
 
BUD17-302: LLVM Internals #2
BUD17-302: LLVM Internals #2 BUD17-302: LLVM Internals #2
BUD17-302: LLVM Internals #2
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 Platform
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
 
Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)Database concurrency control &amp; recovery (1)
Database concurrency control &amp; recovery (1)
 
BUD17-218: Scheduler Load tracking update and improvement
BUD17-218: Scheduler Load tracking update and improvement BUD17-218: Scheduler Load tracking update and improvement
BUD17-218: Scheduler Load tracking update and improvement
 
Distributed system &amp; its characteristic
Distributed system &amp; its characteristicDistributed system &amp; its characteristic
Distributed system &amp; its characteristic
 
Mobile os (msquare)
Mobile os (msquare)Mobile os (msquare)
Mobile os (msquare)
 
Core java slides
Core java slidesCore java slides
Core java slides
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processor
 

Similar a Re-implementing Thrift using MDE

Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
Vasavi College of Engg
 
Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayamba
Prageeth Sandakalum
 

Similar a Re-implementing Thrift using MDE (20)

.Net Session Overview
.Net Session Overview.Net Session Overview
.Net Session Overview
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worldsmbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
 
.Net Framework
.Net Framework.Net Framework
.Net Framework
 
Epsilon
EpsilonEpsilon
Epsilon
 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel Hardware
 
ALT
ALTALT
ALT
 
Source-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructureSource-to-source transformations: Supporting tools and infrastructure
Source-to-source transformations: Supporting tools and infrastructure
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
Chapter 1 introduction to .net
Chapter 1 introduction to .netChapter 1 introduction to .net
Chapter 1 introduction to .net
 
Introduction To MDD
Introduction To MDDIntroduction To MDD
Introduction To MDD
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
 
Compiler_Lecture1.pdf
Compiler_Lecture1.pdfCompiler_Lecture1.pdf
Compiler_Lecture1.pdf
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayamba
 
Architecting Domain-Specific Languages
Architecting Domain-Specific LanguagesArchitecting Domain-Specific Languages
Architecting Domain-Specific Languages
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
 

Último

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Último (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 

Re-implementing Thrift using MDE

  • 2.  A software framework which enables cross-platform (asynchronous) communication via Remote Procedure Call  Does this through an Interface Definition Language (IDL)  Define services and the functions provided by these services  Supports complex data types (struct, list, map etc.)
  • 3. MyCalculator.thrift i32 add(i32 num1, i32 num2); i32 subtract(i32 num1, i32 num2); i64 multiply(i32 num1, i32 num2); double divide(i32 num1, i32 num2); Compiler thrift –-gen [language] “MyCalculator.thrift” MyCalculator.java Client code Server code MyCalculator.py Client code Server code MyCalculator.cpp Client code Server code
  • 4.  Re-implement (a subset of) Thrift’s compiler using MDE tools – more specifically, the parser + 2 output languages  Evaluate the model-driven approach and current MDE technologies for implementing intermediate languages  Compare to existing implementation to observe benefits and drawbacks of the MDE approach
  • 5.  No reports on replicating existing compilers using MDE  Wide variance in productivity gains  MDE adoption – good tools are high priority, but not the only concern – “necessary but insufficient”  Benefits: improved communication and transparency of design
  • 6. .thrift file flex (Lexer) Bison (Parser) Semantic Validation Code generation Output files  C++ based (a primarily systems programming language)  Low-level parsing tools (manually build AST and types)  Validation performed at various stages  Code generation difficult to read (lots of functions)
  • 7.  Java-based tools  Eclipse Modelling Framework (EMF)  Xtext for parsing  Epsilon for validation and code generation  Solution centred around the IDL’s (meta)model
  • 8.  Define the grammar using Xtext  Self-documenting EBNF notation  Automatically generates Ecore metamodel  Lexing and parsing handled automatically  Editor support with syntactic validation and highlighting
  • 9.  Context-free grammar cannot capture language semantics  Need to ensure semantics and scoping are valid  For example, this is syntactically valid, but does it make sense? const list<i32> myNumberz = “a string!”;  Use Epsilon Validation Language to express these constraints
  • 10.  Epsilon Generation Language (EGL) – template-based M2T  Static sections output verbatim  Dynamic sections expressed in Epsilon Object Language (EOL)  Can use operations, imports, extended properties etc.  EGX invokes EGL templates with parameters
  • 11.  Took a TDD approach to implementing code generators  Various complex Thrift IDL files available on website  Auto-generated editor validates syntax  Eclipse file comparison editor to highlight output differences  Automated tests using JUnit (compare as strings or file size)
  • 12. Stage/Implementation C++ (existing) EMF (model-driven) Language definition (parsing & validation) 3419 (105 KB) 447 (14 KB) Language-agnostic code 712 (22KB) 1036 (26 KB) Java generator 5129 (187 KB) 2224 (73 KB) Ruby generator 1231 (40 KB) 422 (14 KB) Overall total >10491 (~395 KB) 4149 (~128 KB)
  • 13.  More concise – less code to do (more or less) the same job  Reduced coupling and higher cohesion  Higher level of abstraction – focus on what actually matters  Easier to understand what’s happening at each stage  Arguably more modifiable and easier to maintain as a result
  • 14.  Greater dependence on tools and libraries (EMF, Xtext, Epsilon)  Performance is significantly worse due to the overhead of these tools compared to the “close-to-metal” C++ solution  Troubleshooting and long-term support (skills, complexity of underlying MDE technologies...)
  • 15.  First complete re-implementation using MDE technologies of such a complex system  MDE solution is significantly more concise overall  Main benefits come in the form of readability, cohesion and, arguably, a more intuitive workflow  Need to formally evaluate subjective aspects - e.g. readability, modifiability, understandability, maintainability...  Would the results be similar for other IDL frameworks?
  • 16.  Thank you for listening!
  • 17. .thrift IDL file “Interpreter” Grammar definition file Lexer/Parser has a Metamodel makes a conforms to Validator Model elements Constraints uses Code generator Templates Additional files Model Model uses Output files in target language if no constraints are violated
  • 18. Headers / imports Regular Expressions Action to take (code block) Additional code Generated parser Output directly Output directly Thrift C++ compiler flex and Bison

Notas del editor

  1. Observations – biased?