3. High-Level Languages
Problem
HLL Machine
Domain
"A programming language is low level when its programs
require attention to the irrelevant." Alan J. Perlis (1982)
HLLs reduce gap
5. Software Language Design & Engineering
enable software engineers to
effectively design, implement,
and apply domain-specific
software languages
6. Research: Software Language Engineering
automatically derive efficient,
scalable, incremental compiler +
usable IDE from high-level,
declarativelanguage
definition
7. The Spoofax Language Workbench
creating full featured IDEs for domain-specific languages
8. Research: Software Language Design
systematically design domain-specific
software languages
with optimal tradeoff between
expressivity, completeness, portability,
coverage, and maintainability
9. Software Language Design Case Studies
Mobl: client-side stateful web applications
WebDSL: server-side restful web applications
10. Two Talks
Declaratively Programming
the Mobile Web with Mobl
The Spoofax Language Workbench
11. Declaratively Programming
the Mobile Web with Mobl*
Zef Hemel Eelco Visser
http://zef.me http://eelcovisser.org
* To appear: SPLASH/OOPSLA, October 2011, Portland
12. Divergence in Mobile Platforms
Objective-C Java J2ME/C++
HTML/Javascript Java .NET
Native Applications not Portable
13. Convergence in Mobile Platform
Webkit browser Webkit browser
Webkit browser Webkit browser
18. Software Engineering with JavaScript
annotated HTML imperative Javascript
MVC, No Integration, No Abstraction, Accidental Complexity
19. Late Failures in Web Applications
Zef Hemel, Danny M. Groenewegen, Lennart C. L. Kats, Eelco Visser.
Static consistency checking of web applications with WebDSL. Journal of
Symbolic Computation, 46(2):150-182, 2011.
43. Mobl Summary
❖ Linguistic integration
★ data model, user interface, styling, application logic
❖ Domain abstractions
★ reduce accidental complexity, platform details
❖ User-defined abstractions
★ data binding
★ reactive programming
★ reusable controls
❖ Model-View
★ automate the controller
44. Mobl IDE: Static Cross-Concern Consistency Checking
Constructed on Spoofax Language Workbench
45. The Spoofax Language Workbench*
Rules for Declarative Specification of Languages and IDEs
Lennart Kats Eelco Visser
http://www.lclnet.nl http://eelcovisser.org
* OOPSLA 2010
46. Research: Software Language Engineering
Automatically derive efficient,
scalable, incremental compiler +
usable IDE from high-level,
declarativelanguage
definition
47. Language Definitions for Compilers
Syntax definition
★ concrete syntax
★ abstract syntax
Static semantics
★ error checking
★ name resolution
★ type analysis
Model-to-model transformation
★ express constructs in core language
Code generation
★ translate core language models to implementation
57. Syntactic Normalization and Desugaring
rules
normalize :
FunctionNoReturnType(manno*, name, farg*, stat*) ->
Function(manno*, name, farg*,
SimpleType(QId("mobl", "void")), stat*)
normalize :
IfNoElse(e, block) -> If(e, block, Block([]))
desugar :
ForInferred(lvalue, e, elem*) -> For(lvalue, t, e, elem*)
where GenericType(_, [t]) := <type-of> e
58. CPS Transform
cps-lift-exprs :
[Return(e)|stats] ->
<concat>[stats2, [Return(e2)|<cps-lift-expressions> stats]]
where not(<is-sync> e)
with {| Exp
: stats2 := <cps-lift-expression> e
; e2 := <Exp>
|}
59. Type Analysis
eq-type-of :
String(_) -> SimpleType(QId("mobl", "String"))
eq-type-of :
FieldAccess(e, x) -> t
where Property(_, _, t, _) := <lookup-property> (<type-of> e, x)
60. Type Checking
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)
origin tracking
64. Software Language Design & Engineering
Linguistic abstraction:
capture software knowledge in
domain-specific languages http://spoofax.org
separation of concerns + linguistic integration http://mobl-lang.org
cross concern consistency checking http://webdsl.org
early detection of failures http://researchr.org
Language workbench: DSL design and http://eelcovisser.org
implementation with less effort than
traditional language engineering
http://researchr.org/search/publication/mobl+spoofax+webdsl