1 of 17

ACME DSL in MPS

Geek Gathering November 2013

2 of 17

3 of 17

4 of 17

Language Workbench

Domain Specific Languages

Product Line Engineering

5 of 17

Language Workbench

Domain Specific Languages

Product Line Engineering

6 of 17

General-Purpose Language (GPL)

Domain Specific Language (DSL)

7 of 17

digraph G {�� subgraph cluster_0 {� style=filled;� color=lightgrey;� node [style=filled,color=white];� a0 -> a1 -> a2 -> a3;� label = "process #1";� }�� subgraph cluster_1 {� node [style=filled];� b0 -> b1 -> b2 -> b3;� label = "process #2";� color=blue� }� start -> a0;� start -> b0;� a1 -> b3;� b2 -> a3;� a3 -> a0;� a3 -> end;� b3 -> end;� start [shape=Mdiamond];� end [shape=Msquare];�}

8 of 17

Internal DSL

External DSL

ruby (GPL)

rake

make

9 of 17

task :default => ["hello"]

SRC = FileList['*.c']

OBJ = SRC.ext('o')

rule '.o' => '.c' do |t|

sh "cc -c -o #{t.name} #{t.source}"

end

file "hello" => OBJ do

sh "cc -o hello #{OBJ}"

end

# File dependencies go here ...

file 'main.o' => ['main.c', 'greet.h']

file 'greet.o' => ['greet.c']

SRC := $(wildcard *.c)

OBJ := $(SRC:.c=.o)

all: hello

.o.c:

cc -c -o $@ $<

hello: $(OBJ)

cc -o hello $(OBJ)

main.o: main.c greet.h

greet.o: greet.c

10 of 17

Lexer

Parser

AST

Generator

Interpreter

Syntax highlighting

Content

Assistent

Navigation

Refactoring

...

Language Workbench

Compiler

Runtime

IDE

11 of 17

...

12 of 17

Parser / Text Based

Projectional Editing

13 of 17

14 of 17

GO MPS

15 of 17

Presentation on Google Docs

https://docs.google.com/presentation/d/1fVZKSu_fKXx_XlLCSVBrx8UTCvGDd3Ew3ber5XeuNfA/edit?usp=sharing

Code on GitHub

https://github.com/GeekGathering/AcmeCoffee

Download MPS from Jetbrains

http://www.jetbrains.com/mps/

16 of 17

Thank You

Geek Gathering November 2013

17 of 17

General-Purpose Language (GPL)

Domain Specific Language (DSL)