5. Domain-Specific Languages
Even Higher-
Level
Languages
Problem
DSL HLL Machine
Domain
domain-specific languages support more specialization
6. Software Language Design & Engineering
enable software engineers to
effectively design, implement,
and apply domain-specific
software languages
7. Research: Software Language Design
Systematically design domain-
specific software
languages with optimal
tradeoff between expressivity,
completeness, portability, coverage, and
maintainability
47. Syntax Definition
module MoBL-Data
imports
Common
MoBL
exports
context-free syntax
MetaAnno* "entity" QId ":" Type "{" Property* "}" -> Definition {cons("Entity")}
MetaAnno* "entity" QId "{" Property* "}" -> Definition {cons("EntityNoSuper")}
MetaAnno* ID ":" Type "(" {Anno ","}* ")" -> Property {cons("Property")}
MetaAnno* ID ":" Type -> Property {cons("PropertyNoAnnos")}
ID -> Anno {cons("SimpleAnno")}
"inverse" ":" ID -> Anno {cons("InverseAnno")}
context-free syntax
"@sync" UriPath -> MetaAnno {cons("SyncEntityAnno")}
48. Type Checking
rules
constraint-error :
t@SimpleType(_) -> (t, $[Type is not defined: [<pp-mobl-type> t]])
where not(<lookup-type> t)
constraint-error :
t@FieldAccess(e, x) -> (t, $[Property [x] not defined])
where <type-of> e
where not(type-of)
49. Code Generation
rules
property-to-js(|ent) :
Property(_, x, t@SimpleType(_), anno*) -> $['[x]': '[sqlType]']
where not(<is-entity-type> t)
with sqlType := <sql-type> t
; if [_] := <filter(?SimpleAnno("searchable"))> anno* then
rules ( SearchableProperties :+= (ent, x) )
end
50. Software Language Design & Engineering
http://eelcovisser.org
Language Design as Engineering Discipline
http://spoofax.org
(More) Declarative Language Definition
http://mobl-lang.org
Static Analysis of Language Definitions
http://webdsl.org
Language Workbench in the Cloud
http://researchr.org
http://researchr.org/search/publication/mobl+spoofax+webdsl