57
Developing Interacting Domain Specific Languages Developing Interacting Domain Specific Languages Master’s thesis Sander Mak Center for Software Technology, Universiteit Utrecht October 25, 2007 Supervisor : Doaitse Swierstra Daily supervision : Bastiaan Heeren Eelco Visser Center for Software Technology Sander Mak

Interacting Domain Specific Languages

Embed Size (px)

DESCRIPTION

My final thesis presentation describing research on multiple interacting Domain Specific Languages.

Citation preview

Page 1: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages

Developing Interacting Domain Specific LanguagesMaster’s thesis

Sander Mak

Center for Software Technology, Universiteit Utrecht

October 25, 2007

Supervisor : Doaitse SwierstraDaily supervision : Bastiaan Heeren

Eelco Visser

Center for Software Technology Sander Mak

Page 2: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Outline

1 Introduction

2 DomainModel

3 WebLayer

4 Interaction

5 Reflection

6 Conclusion

Center for Software Technology Sander Mak

Page 3: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Domain Specific Language

Advantages:

Increased productivity

Increased quality

Clarity by abstraction

Center for Software Technology Sander Mak

Page 4: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Languages?

Why the plural, i.e. DSLs

One-size fits all, monolithicapproaches generally notsuccesful (like 4GLs)

Separation of concerns, and:reusability of DSL in othercontexts

Premise: Technical domains are agood unit of composition

Research questions:

1 Are multiple interacting DSLs feasible?

2 How should interaction be concretized and implemented?

Center for Software Technology Sander Mak

Page 5: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Languages?

Why the plural, i.e. DSLs

One-size fits all, monolithicapproaches generally notsuccesful (like 4GLs)

Separation of concerns, and:reusability of DSL in othercontexts

Premise: Technical domains are agood unit of composition

Research questions:

1 Are multiple interacting DSLs feasible?

2 How should interaction be concretized and implemented?

Center for Software Technology Sander Mak

Page 6: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Languages?

Why the plural, i.e. DSLs

One-size fits all, monolithicapproaches generally notsuccesful (like 4GLs)

Separation of concerns, and:reusability of DSL in othercontexts

Premise: Technical domains are agood unit of composition

Research questions:

1 Are multiple interacting DSLs feasible?

2 How should interaction be concretized and implemented?

Center for Software Technology Sander Mak

Page 7: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Languages?

Why the plural, i.e. DSLs

One-size fits all, monolithicapproaches generally notsuccesful (like 4GLs)

Separation of concerns, and:reusability of DSL in othercontexts

Premise: Technical domains are agood unit of composition

Research questions:

1 Are multiple interacting DSLs feasible?

2 How should interaction be concretized and implemented?

Center for Software Technology Sander Mak

Page 8: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

The case study

DomainModel Modeling domain data, generatingJPA (similar to Hibernate) implementation

WebLayer Modeling the view side of web-applications,generating Seam/JSF/Facelets

BusinessRules Modeling functionality specific to a domain

Different compilers, one goal: build a complete Java based web-app

Center for Software Technology Sander Mak

Page 9: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Goals

Why create DSLs for these domains:

Increase productivityAbstract away from implementation details, focus on domainconcepts (also gives more clarity)Java frameworks are (inherently?) verbose

Increase qualityDynamic, interpreted mechanisms subvert static safety of Java codeReport domain specific errors

What is explicitly not our goal:

creation of production quality languages,unleashing every bit of power of target frameworks

Center for Software Technology Sander Mak

Page 10: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Goals

Why create DSLs for these domains:

Increase productivityAbstract away from implementation details, focus on domainconcepts (also gives more clarity)Java frameworks are (inherently?) verbose

Increase qualityDynamic, interpreted mechanisms subvert static safety of Java codeReport domain specific errors

What is explicitly not our goal:

creation of production quality languages,unleashing every bit of power of target frameworks

Center for Software Technology Sander Mak

Page 11: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Introduction

Goals

Why create DSLs for these domains:

Increase productivityAbstract away from implementation details, focus on domainconcepts (also gives more clarity)Java frameworks are (inherently?) verbose

Increase qualityDynamic, interpreted mechanisms subvert static safety of Java codeReport domain specific errors

What is explicitly not our goal:

creation of production quality languages,unleashing every bit of power of target frameworks

Intended use

To create data-intensive web-applications, within confines ofcompany guidelines.

‘You can’t be everything to everyone,so be something for someone’

Center for Software Technology Sander Mak

Page 12: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

DomainModel language

Language for defining persistent domain (or data) models

Essential features:

Concise definition of concepts (entities)

Generates JPA implementation (standardized library)

Encodes domain specific technical knowledge (e.g. object identity)

Allows for domain specific semantic checking

May be used in combination with different DSLs

Center for Software Technology Sander Mak

Page 13: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Center for Software Technology Sander Mak

Page 14: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Types: Value, Extended (validated), Concept, List, Enumeration

Center for Software Technology Sander Mak

Page 15: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Types: Value, Extended (validated), Concept, List, Enumeration

Center for Software Technology Sander Mak

Page 16: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Types: Value, Extended (validated), Concept, List, Enumeration

Center for Software Technology Sander Mak

Page 17: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Types: Value, Extended (validated), Concept, List, Enumeration

Center for Software Technology Sander Mak

Page 18: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Types: Value, Extended (validated), Concept, List, Enumeration

Center for Software Technology Sander Mak

Page 19: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Associations: Value, Reference, Composite

Center for Software Technology Sander Mak

Page 20: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Associations: Value, Reference, Composite

Center for Software Technology Sander Mak

Page 21: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

Associations: Value, Reference, Composite

Center for Software Technology Sander Mak

Page 22: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

DomainModel annotations

Center for Software Technology Sander Mak

Page 23: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

DomainModel annotations

Center for Software Technology Sander Mak

Page 24: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

DomainModel annotations

Compiling a DomainModel concept

Definition BlogEntry results in BlogEntry.java, apersistable JPA entity:

268 LoC

Center for Software Technology Sander Mak

Page 25: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > DomainModel

Concept definition

concept BlogEntry {title :: String (name, required)abstract :: Stringcontents :: String (required)user -> Userdate :: Date (name)tags -> [Tag]replies <> [Reply]category :: {"Technical" : TECH, "Other" : NONTECH}trackback :: URL

}

DomainModel annotations

Q: Isn’t DomainModel almost the same as UML Class diagrams?

A: Yes!

We even ’borrowed’ some of the association symbols

’−>’ for references’<>’ for composites

That way, prior UML knowledge helps when usingDomainModel

Theoretically, a UML class diagram could serve as input forthe DomainModel compiler (if only we had a UMLfront-end)

Center for Software Technology Sander Mak

Page 26: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

WebLayer language

Language for defining pages (views) in web-app

Essential features:

Works seamlessly with DomainModel definitions

Abstracts away from the Seam framework and Java intricacies

Strongly typed

Explicit, checked data-flow between pages

Generic constructs

Center for Software Technology Sander Mak

Page 27: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

WebLayer compiler

Center for Software Technology Sander Mak

Page 28: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 29: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 30: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}

Multiple page definitions in one file, starting with a header:

weblayer blog

using domainmodel blog

Center for Software Technology Sander Mak

Page 31: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 32: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 33: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 34: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 35: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 36: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}Center for Software Technology Sander Mak

Page 37: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Page definition

page ViewBlog(BlogEntry be, User u){var Reply r

header(be.title + " (written on " + be.date + ")")text(be.contents)table Tag t in be.tags { "Assigned tags" -> t.tagName }

"Reply to this post:"form( input(r)

action( "Add reply", r.user = u; be.replies.add(r); be.save())

)

text("Replies for post " + be.title + " :")for Reply r in be.replies { show(r) }navigate("Home", Blog(u))

}

Ideas for extension

Query language

Partial page abstraction

Parameterized, reusable actions

...

Center for Software Technology Sander Mak

Page 38: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > WebLayer

Issues

Layout is more or less fixed

Example: every page element is placed beneath each otherWe don’t want to replicate all of HTML inside WebLayerPartial solution: embed generated page in freely editable templateFor the rest: make assumptions, although compiler becomes morespecific

Editing lists

Our solution is specific and ad-hoc

Action language

Why not, for example, embed Java?

Center for Software Technology Sander Mak

Page 39: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

DSL Interaction

We can use DomainModel constructs within WebLayer, but how doesthis interaction work?

Goals

Interaction must be intuitive to DSL user

Languages must be as separate as possible

For the sake of reusability

Generated code must statically link

Our solution

Separate compilation for each DSL, communicating essentialinformation through interface files.

Center for Software Technology Sander Mak

Page 40: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

DSL Interaction

We can use DomainModel constructs within WebLayer, but how doesthis interaction work?

Goals

Interaction must be intuitive to DSL user

Languages must be as separate as possible

For the sake of reusability

Generated code must statically link

Our solution

Separate compilation for each DSL, communicating essentialinformation through interface files.

Center for Software Technology Sander Mak

Page 41: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

DSL Interaction

We can use DomainModel constructs within WebLayer, but how doesthis interaction work?

Goals

Interaction must be intuitive to DSL user

Languages must be as separate as possible

For the sake of reusability

Generated code must statically link

Our solution

Separate compilation for each DSL, communicating essentialinformation through interface files.

Separate compilation illustrated

Center for Software Technology Sander Mak

Page 42: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

Interface files

DSL compiler emits interface file. We chose ATerms as genericrepresentation format.

Interface characteristics

Aggregates information

Contains disambiguated information

Contains linking information (types, hooks)

Written interface guarantees a consistent, checked module to bepresent

One way to view interface file mechanism is as cache for compileroperations

Issues: explicit vs. implicit interface, cyclic dependencies betweenDSLs

Center for Software Technology Sander Mak

Page 43: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

Interface files

DSL compiler emits interface file. We chose ATerms as genericrepresentation format.

Interface characteristics

Aggregates information

Contains disambiguated information

Contains linking information (types, hooks)

Written interface guarantees a consistent, checked module to bepresent

One way to view interface file mechanism is as cache for compileroperations

Issues: explicit vs. implicit interface, cyclic dependencies betweenDSLs

Center for Software Technology Sander Mak

Page 44: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

Interface files

DSL compiler emits interface file. We chose ATerms as genericrepresentation format.

Interface characteristics

Aggregates information

Contains disambiguated information

Contains linking information (types, hooks)

Written interface guarantees a consistent, checked module to bepresent

One way to view interface file mechanism is as cache for compileroperations

Issues: explicit vs. implicit interface, cyclic dependencies betweenDSLs

Q: Why cache, are these operations so expensive?

A: No, not at all. The issue is that the importing compilerotherwise needs to know how to perform these operations. Wedon’t want that, since it breaks our notion of modular interactinglanguages!

Center for Software Technology Sander Mak

Page 45: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Interaction

Interface files

DSL compiler emits interface file. We chose ATerms as genericrepresentation format.

Interface characteristics

Aggregates information

Contains disambiguated information

Contains linking information (types, hooks)

Written interface guarantees a consistent, checked module to bepresent

One way to view interface file mechanism is as cache for compileroperations

Issues: explicit vs. implicit interface, cyclic dependencies betweenDSLs

Center for Software Technology Sander Mak

Page 46: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Does this approach really work?

Promises of model driven software development:

Gain productivity

Gain quality

... so do we live up to this expectation?

Productivity:1 The factor ∼14 increase in LoC seems to be typical2 DRY: refactoring in DSL code is much easier3 Start-up costs manageable

Quality:1 DSL Type checker guarantees correctness of dynamic

constructions (and there’s much of that in Java web frameworks!)2 Typed, explicit dataflow between pages3 Concrete example: guaranteed prevention of cross-site scripting

Center for Software Technology Sander Mak

Page 47: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Does this approach really work?

Promises of model driven software development:

Gain productivity

Gain quality

... so do we live up to this expectation?LoC metrics - Blog example

DSL Source Generated code

DomainModel 45Java 801XML 22

WebLayer 110Java 841

XML/Facelets 501XML 48

Totals 155 2213 ∼ ×14

Productivity:1 The factor ∼14 increase in LoC seems to be typical2 DRY: refactoring in DSL code is much easier3 Start-up costs manageable

Quality:1 DSL Type checker guarantees correctness of dynamic

constructions (and there’s much of that in Java web frameworks!)2 Typed, explicit dataflow between pages3 Concrete example: guaranteed prevention of cross-site scripting

Center for Software Technology Sander Mak

Page 48: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Does this approach really work?

Promises of model driven software development:

Gain productivity

Gain quality

... so do we live up to this expectation?

Productivity:1 The factor ∼14 increase in LoC seems to be typical2 DRY: refactoring in DSL code is much easier3 Start-up costs manageable

Quality:1 DSL Type checker guarantees correctness of dynamic

constructions (and there’s much of that in Java web frameworks!)2 Typed, explicit dataflow between pages3 Concrete example: guaranteed prevention of cross-site scripting

Center for Software Technology Sander Mak

Page 49: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Does this approach really work?

Promises of model driven software development:

Gain productivity

Gain quality

... so do we live up to this expectation?

Productivity:1 The factor ∼14 increase in LoC seems to be typical2 DRY: refactoring in DSL code is much easier3 Start-up costs manageable

Quality:1 DSL Type checker guarantees correctness of dynamic

constructions (and there’s much of that in Java web frameworks!)2 Typed, explicit dataflow between pages3 Concrete example: guaranteed prevention of cross-site scripting

Center for Software Technology Sander Mak

Page 50: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Drawbacks of our approach

Every semantic check must be written from scratch

For each DSL

Type checking, resolving symbolic references, and so on

Fortunately, we can get very specific with our checks andassociated messages

Module system must be written from scratch

This might be solved generically (parameterizing over interfacedefinitions), though we have not researched this

What are the semantics of our DSLs?

Center for Software Technology Sander Mak

Page 51: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Drawbacks of our approach

Every semantic check must be written from scratch

For each DSL

Type checking, resolving symbolic references, and so on

Fortunately, we can get very specific with our checks andassociated messages

Module system must be written from scratch

This might be solved generically (parameterizing over interfacedefinitions), though we have not researched this

What are the semantics of our DSLs?

Center for Software Technology Sander Mak

Page 52: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Drawbacks of our approach

Every semantic check must be written from scratch

For each DSL

Type checking, resolving symbolic references, and so on

Fortunately, we can get very specific with our checks andassociated messages

Module system must be written from scratch

This might be solved generically (parameterizing over interfacedefinitions), though we have not researched this

What are the semantics of our DSLs?

Center for Software Technology Sander Mak

Page 53: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Alternative approaches

Embedded DSLs

Asynchronous, runtime linking of generated code (independentcode generation)

Larger role for the IDE

Long-term: active libraries and a universal language

Realistically, this probably never happens

Center for Software Technology Sander Mak

Page 54: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Reflection

Alternative approaches

Embedded DSLs

Asynchronous, runtime linking of generated code (independentcode generation)

Larger role for the IDE

Long-term: active libraries and a universal language

Realistically, this probably never happens

Center for Software Technology Sander Mak

Page 55: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Conclusion

Demonstration

Center for Software Technology Sander Mak

Page 56: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Conclusion

Topics not discussed... but interesting nevertheless

1 Actual implementation details of compilers

Implemented using Stratego/XT toolkit

2 BusinessRules interface definition

To overcome limitations of WebLayer action language in multipleDSL style

3 Interaction with GPL code

Necessary for real-world adoptation, but how to implement it?

4 Much more context and related work

... my thesis will be available shortly

Center for Software Technology Sander Mak

Page 57: Interacting Domain Specific Languages

Developing Interacting Domain Specific Languages > Conclusion

Concluding remarks

Interacting DSLs indeed feasible

Especially suited for layered architectures (like web-applications)DSLs encode principled usage of frameworks and frameworkinteraction

Interaction implemented through interface files

Separate compilation allows for reuse of DSLsImplicit interface may be a limiting factor

DSLs for technical domains are a serious option for a company topursue, with demonstrated advantages, but also requiring considerableeffort.

Center for Software Technology Sander Mak