Top Banner
Arik Hadas Dept. of Mathematics and Computer Science The Open University of Israel Joint Work With: David H. Lorenz Demanding First-Class Equality for Domain Specific Aspect Languages
27

Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Mar 09, 2018

Download

Documents

lamdan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Arik HadasDept. of Mathematics and Computer Science

The Open University of Israel

Joint Work With:

David H. Lorenz

Demanding First-Class Equality for Domain Specific Aspect Languages

Page 2: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Domain Specific Aspect Languages

DSLs DSALs AOP

KALA

COOL

RIDL

AspectGrid

Racer

AO4SQL

Page 3: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

DSALs are Second-class

● Second-class DSLs– Not as easy to develop and to use

● Second-class AOP languages– Incompatible with AOP tools

Page 4: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Background

Language workbenches: The killer-app for domain specific languages

abc: an extensible AspectJ compiler

2005

DSAL

DSL

Page 5: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Background

Language workbenches: The killer-app for domain specific languages

abc: an extensible AspectJ compiler

DSAL

DSL

2005

Page 6: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Background

Language workbenches: The killer-app for domain specific languages

Language workbenches (LW)

– xtext, MPS, Spoofax

AOP composition frameworks (CF)

– Reflex, XAspects, AWESOME

abc: an extensible AspectJ compiler

Since 2005

DSAL

DSL

2005

Page 7: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Background

Language workbenches: The killer-app for domain specific languages

Language workbenches (LW)

– xtext, MPS, Spoofax

AOP composition frameworks (CF)

– Reflex, XAspects, AWESOME

abc: an extensible AspectJ compiler

Since 2005

DSAL

DSL

2005

Page 8: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Background

Language workbenches: The killer-app for domain specific languages

Language workbenches (LW)

– xtext, MPS, Spoofax

AOP composition frameworks (CF)

– Reflex, XAspects, AWESOME

abc: an extensible AspectJ compiler

Since 2005

DSAL

DSL

But no workbench solution for DSALs

2005

Page 9: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Language Workbench (LW)

Language WorkbenchLanguage Workbench

javacjavac

DSL Code

Java

Bytecode

Page 10: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Language Workbench (LW)

Language WorkbenchLanguage Workbench

javacjavac

DSL Code

Java

Bytecode

Page 11: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Using LW for DSAL

Language WorkbenchLanguage Workbench

javacjavac

Java

Bytecode

NoAspects

DSL CodeDSAL Code

Page 12: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Using LW for DSAL

Language WorkbenchLanguage Workbench

javacjavac

Java

Bytecode

NoAspects

DSL CodeDSAL Code

Page 13: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

LW for AspectJ

Language WorkbenchLanguage Workbench

DSAL Code

Java AspectJ

BytecodeWoven Bytecode

javac ajc

No Multiple DSALs

Page 14: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

DSAL Complexity● Unlike DSL, DSAL tackles crosscutting

concerns

DSLs DSALs

Page 15: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Looking for a DSAL Workbench

Language Workbench

AOP Composition Framework

Tools for creation & usage of languages

Defining weaving semantics needed for DSALs

Page 16: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Looking for a DSAL Workbench

Language Workbench

AOP Composition Framework

Tools for creation & usage of languages

Defining weaving semantics needed for DSALs

Will a naive combination of the two be a proper solution?

Page 17: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Naive Combination of LW and CF

Language WorkbenchLanguage Workbench

DSAL Code

AspectJ

Woven Bytecode

ajc Composition Framework

First-class DSL

Page 18: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

But Still Second-class AOP

Language WorkbenchLanguage Workbench

DSAL Code

AspectJ

Woven Bytecode

Composition Framework

Browsing

Debugging

Compiling

Page 19: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Traditional LW Architecture

Language WorkbenchLanguage Workbench

DSAL Code

AspectJ

Woven Bytecode

Composition Framework

Code Transformation

Page 20: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

DSAL Workbench Architecture

Composition Framework Composition Framework

DSAL Code

Woven Bytecode

Language WorkbenchLanguage Workbench

AspectJ DSAL Code

First-class AOP

Code Transformation

Page 21: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

DSAL Workbench Architecture

Composition Framework Composition Framework

DSAL Code

Woven Bytecode

Language WorkbenchLanguage Workbench

DSAL Code

StandaloneDSAL compiler

Can generate debugging & browsing information

First-class AOP

Code Transformation

Page 22: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Implementation

AWESOME*AWESOME*

DSAL Code

Woven Bytecode

SpoofaxSpoofax

DSAL Code

Code Transformation

Page 23: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Example: First Class COOL

Page 24: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

DSAL “Bill of Rights”

•Freedom of Expression• Syntactic• Semantic

•Economic Freedom• Cost effective Implementation• Cost effective Usage

•Freedom of Assembly• DSL Interoperability

•Equality with domain­specific languages and AOP languages

Page 25: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Related Work

● Language Workbenches

– [Fowler, 2005] Language workbenches: The killer-app for domain specific languages.

– [Kats and Visser, 2005] The Spoofax language workbench: Rules for declarative specification of languages and IDEs.

– [Lorenz and Rosenan, 2011] Cedalion: A language for language oriented programming.

● AOP Composition Frameworks

– [Kojarski and Lorenz, 2005] Pluggable AOP: Designing aspect mechanisms for third-party composition.

– [Lorenz and Kojarski, 2007] Understanding aspect interaction, co-advising and foreign advising.

– [Kojarski and Lorenz, 2007] Awesome: An aspect co-weaving system for composing multiple aspect-oriented extensions.

Page 26: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Conclusion● A novel design for DSAL workbench that produces

first-class DSAL

– First-class DSL

– First-class AOP language● Prototype comprising Spoofax and AWESOME*

● Plug-in for COOL as a first-class DSAL

Page 27: Demanding First-Class Equality for Domain Specific Aspect ...ahadas.github.io/slides/position_15.pdf · Second-class DSLs ... – xtext, MPS, Spoofax AOP composition ... Java Bytecode

Arik Hadas and David H. LorenzDept. of Mathematics and Computer Science

The Open University of Israel

[email protected]

https://github.com/OpenUniversity

Thank You!