ACME DSL in MPS
Geek Gathering November 2013
Language Workbench
Domain Specific Languages
Product Line Engineering
Language Workbench
Domain Specific Languages
Product Line Engineering
General-Purpose Language (GPL)
Domain Specific Language (DSL)
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];�}
Internal DSL
External DSL
ruby (GPL)
rake
make
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
Lexer
Parser
AST
Generator
Interpreter
Syntax highlighting
Content
Assistent
Navigation
Refactoring
...
Language Workbench
Compiler
Runtime
IDE
...
Parser / Text Based
Projectional Editing
GO MPS
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/
Thank You
Geek Gathering November 2013
General-Purpose Language (GPL)
Domain Specific Language (DSL)