DSL explained _

Preview:

DESCRIPTION

Explanation of what DSLs are with slight shift towards MPS. Slides from my talk at Deutsche Bank. There is nothing particulary new in these slides, there are mostly based on Martin Fowler talks and book (http://www.martinfowler.com/dslwip/).

Citation preview

(Domain Specific Language,not Direct Server Link)

dmitry.kandalov@db.com

DSL explained

DSL premises

and only then for computers

Code is written for

people

Objects ---> Vocabulary

Grammar ---> Language

Domain Driven Design

DSL

DSL is advanced stuff

DSL example(by Martin Fowler)

DSL is a computer language with:

human language nature

limited expressiveness

domain focus

DSL types

internal external

language workbench

Internal DSLexample

External DSLexample

Language workbenchexample

More examples

regular expressions

CSSSQL

all XML

Unix config filesRuby on Rails

mocking frameworks

wiki syntax / markdown

LINQ

Using internal DSL(aka Fluent Interface)

Easy to do... no parsers, etc.

Full IDE support

Good

BadLimited by host language

Method chaining

Object scoping

Expression Builder

Using external DSL

Unlimited expressiveness

You choose execution environment

Good

Bad

Requires “more” work

No IDE support

DSLscript

parse

AST Semantic model

optional

You can parse DSL

manually (regexp, Tokenizer)

using some tool(ANTLR, yacc, ...)

Using Language Workbenches

Meta Programming System

Microsoft Oslo

Intentional Domain Workbench

Eclipse Modeling Project

concepts(language)

edit

you

AST(DSL script)

concepts(language)

edit

describe

you

AST(DSL script)

concepts(language)

edit

edit

describe

“user”

you

AST(DSL script)

concepts(language)

edit

describe

“user”

you

no text, just AST !

edit

useful stuff

(like java code)

AST(DSL script)

concepts(language)

edit

describe

transformed

“user”

you

edit

Module Project

Module Project

Solution

Language

Generator

DevKit

kind of

Model Module Project

Solution

Language

Generator

DevKit

kind of

Node Model Module Project

Solution

Language

Generator

DevKit

kind ofincludes

Conceptdefined

by

Internal DSLs rule! :)

Recommended