Software Language Design & Engineering: Mobl & Spoofax
-
Upload
eelco-visser -
Category
Technology
-
view
1.586 -
download
6
description
Transcript of Software Language Design & Engineering: Mobl & Spoofax
![Page 1: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/1.jpg)
Eelco Visserhttp://eelcovisser.org
Software Language Design & Engineering
Microsoft Research, RedmondOctober 20, 2011
![Page 2: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/2.jpg)
bridging the gap between problem domain and solution domain
Software Engineering
ProblemDomain Machine
![Page 3: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/3.jpg)
HLLs reduce gap
High-Level Languages
ProblemDomain HLL Machine
"A programming language is low level when its programs require attention to the irrelevant." Alan J. Perlis (1982)
![Page 4: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/4.jpg)
domain-specific languages support more specialization
Domain-Specific Languages
ProblemDomain HLL MachineDSL
![Page 5: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/5.jpg)
Software Language Design & Engineering
enable software engineers to effectively design, implement, and apply domain-specific
software languages
![Page 6: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/6.jpg)
Research: Software Language Engineering
automatically derive efficient, scalable, incremental compiler +
usable IDE from high-level,
declarative language definition
![Page 7: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/7.jpg)
creating full featured IDEs for domain-specific languages
The Spoofax Language Workbench
![Page 8: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/8.jpg)
Research: Software Language Design
systematically design domain-specific
software languages with optimal tradeoff between
expressivity, completeness, portability, coverage, and maintainability
![Page 9: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/9.jpg)
Software Language Design Case Studies
Mobl: client-side stateful web applications
WebDSL: server-side restful web applications
![Page 10: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/10.jpg)
Two Talks
Declaratively Programming the Mobile Web with Mobl
The Spoofax Language Workbench
![Page 11: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/11.jpg)
Eelco Visserhttp://eelcovisser.org
Declaratively Programming the Mobile Web with Mobl*
* To appear: SPLASH/OOPSLA, October 2011, Portland
Zef Hemelhttp://zef.me
![Page 12: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/12.jpg)
Native Applications not Portable
Divergence in Mobile Platforms
Objective-C Java J2ME/C++
HTML/Javascript Java .NET
![Page 13: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/13.jpg)
Convergence in Mobile Platform
Webkit browser
Webkit browser
Webkit browser
Webkit browser
![Page 14: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/14.jpg)
The Universal Userinterface Engine
![Page 15: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/15.jpg)
Mobile Web Architecture
![Page 16: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/16.jpg)
Rich Applications
WebDatabases
Location information (GPS)
Canvas
Multi-touch
Offline support
Full-screen support
Accelerator support
Audio
![Page 17: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/17.jpg)
Native Applications
Address book
Camera
Compass
File IO
Notifications
![Page 18: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/18.jpg)
MVC, No Integration, No Abstraction, Accidental Complexity
Software Engineering with JavaScript
annotated HTML imperative Javascript
![Page 19: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/19.jpg)
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.
![Page 20: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/20.jpg)
![Page 21: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/21.jpg)
declarativetyped
integrated concise
http://www.mobl-lang.org
![Page 22: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/22.jpg)
Web Application with Touch
![Page 23: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/23.jpg)
Portable Applications
![Page 24: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/24.jpg)
Mobl Architecture
![Page 25: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/25.jpg)
tipcalculator.mobl
application tipcalculator
import mobl::ui::generic
screen root() { var amount = 20 var percentage = 10 header("Tip calculator") group { item { numField(amount, label="amount") } item { numField(percentage, label="percentage") } item { "$" label(Math.round(amount * (1 + percentage/100))) } }}
![Page 26: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/26.jpg)
Model-View Pattern
![Page 27: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/27.jpg)
Task Manager
![Page 28: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/28.jpg)
HTML5 Data Persistence
Data Model
entity Task { name : String (searchable) done : Bool due : DateTime category : Category (inverse: tasks) tags : Collection<Tag> (inverse: tasks)}entity Category { name : String tasks : Collection<Task> (inverse: category)}entity Tag { name : String tasks : Collection<Task> (inverse: tags)}
![Page 29: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/29.jpg)
statically typed: catch errors early
Logic
entity Task { ... function postpone(days : Num) { this.due = DateTime.create( this.due.getFullYear(), this.due.getMonth(), this.due.getDate() + days); } function import(user : String, pw : String) { var tasksJSON = httpRequest("/export?user="+ user + "&pw=" + pw); foreach(t in tasksJSON) { add(Task.fromSelectJSON(t)); } }}
![Page 30: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/30.jpg)
screen root() { var phrase = "" header("Tasks") { button("Add", onclick={ addTask(); }) } searchBox(phrase) group { list(t in Task.search(phrase) limit 20){ item { checkBox(t.done, label=t.name) } } }}
Reactive User Interfaces
![Page 31: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/31.jpg)
screen root() { var phrase = "" header("Tasks") { button("Add", onclick={ addTask(); }) } searchBox(phrase) group { list(t in Task.search(phrase) limit 20){ item { checkBox(t.done, label=t.name) } } }}
screen addTask() { var t = Task() header("Add") { button("Done", onclick={ add(t); screen return; }) } textField(t.name) datePicker(t.due)}
Navigation
![Page 32: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/32.jpg)
Continuations
screen root() { button("Ask", onclick={ alert("Hello " + prompt("First name") + " " + prompt("Last name")); })}screen prompt(question : String) : String { var answer = "" header(question) { button("Done", onclick={ screen return answer; }) } textField(answer)}
![Page 33: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/33.jpg)
User Interface Idiom: Tab
Reusable Controls
screen root() { tabSet([("One", tab1), ("Two", tab2)], defaultTab="One")} control tab1() { header("Tab 1") label("This is tab 1")}control tab2() { header("Tab 2") label("This is tab 2")}
![Page 34: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/34.jpg)
increase coverage: developers can create abstractions
Tab Set: Higher-Order Control
control tabSet(tabs : [(String,Control)], activeTab : String) { list((tabName, tabControl) in tabs) { block(onclick={ activeTab = tabName; }, style=activeTab==tabName ? activeTabButton : inactiveTabButton) { label(tabName) } } list((tabName, tabControl) in tabs) { block(activeTab==tabName ? visibleTab : invisibleTab) { tabControl() } }}
![Page 35: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/35.jpg)
User Interface Idiom: Master Detail
screen root() { header("Tasks") masterDetail( Task.all() order by due desc, taskItem, taskDetail)} control taskItem(t : Task) { checkBox(t.done, label=t.name)}control taskDetail(t : Task) { textField(t.name) datePicker(t.due)}
![Page 36: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/36.jpg)
Master Detail: Higher-Order Control
control masterDetail(items : Collection<?>, masterItem : Control1<?>, detail : Control1<?>) { group { list(it in items) { item(onclick={ detailScreen(it,detail); }) { masterItem(it) } } }}screen detailScreen(it : ?, detail : Control1<?>) { header("Detail") { backButton() } detail(it)}
![Page 37: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/37.jpg)
Adaptive Layout
![Page 38: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/38.jpg)
applications
![Page 39: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/39.jpg)
Mobl Applications
![Page 40: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/40.jpg)
GR8 Conference Program
![Page 41: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/41.jpg)
mPodder
![Page 43: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/43.jpg)
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
![Page 44: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/44.jpg)
Constructed on Spoofax Language Workbench
Mobl IDE: Static Cross-Concern Consistency Checking
![Page 45: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/45.jpg)
Eelco Visserhttp://eelcovisser.org
The Spoofax Language Workbench*Rules for Declarative Specification of Languages and IDEs
* OOPSLA 2010
Lennart Katshttp://www.lclnet.nl
![Page 46: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/46.jpg)
Research: Software Language Engineering
Automatically derive efficient, scalable, incremental compiler +
usable IDE from high-level,
declarative language definition
![Page 47: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/47.jpg)
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
![Page 48: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/48.jpg)
Editor Services for Modern IDEs
Syntactic Editor Services★ syntax checking ★ bracket matching★ syntax highlighting★ code folding★ outline view
Semantic Editor Services★ error checking★ reference resolving★ hover help★ code completion★ refactoring
![Page 49: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/49.jpg)
Syntax Definition with SDF
![Page 50: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/50.jpg)
character-level grammars: integration of lexical and context-free syntax
Declarative Syntax Definition
lexical syntax [a-zA-Z\_\$][a-zA-Z0-9\_]* -> ID
context-free syntax STRING -> LimitedSetExp {cons("String")} NUMBER -> LimitedSetExp {cons("Num")} LimitedSetExp -> Exp QId -> LimitedExp {cons("Var")} "(" Exp ")" -> LimitedExp {cons("Brackets")} Exp BoolMethodId Exp -> Exp {cons("BinMethodCall"), left} Exp CompareMethodId Exp -> Exp {cons("BinMethodCall"), left} Exp TermOperatorMethodId Exp -> Exp {cons("BinMethodCall"), left} Exp OperatorMethodId Exp -> Exp {cons("BinMethodCall"), left}
![Page 51: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/51.jpg)
develop and use language in same environment
An Interactive Language Workbench
![Page 52: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/52.jpg)
Debugging Ambiguities
![Page 53: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/53.jpg)
Declarative Disambiguation
context-free priorities Exp "." ID -> LimitedExp > Exp "." ID "(" {NamedExp ","}* ")" -> LimitedExp > Exp TermOperatorMethodId Exp -> Exp > Exp OperatorMethodId Exp -> Exp > Exp CompareMethodId Exp -> Exp > Exp BoolMethodId Exp -> Exp > "!" Exp -> Exp > Exp "?" Exp ":" Exp -> Exp > LimitedExp Filter+ -> Exp
![Page 54: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/54.jpg)
Parsing after Disambiguation
![Page 55: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/55.jpg)
permissive grammar + backtracking + region discovery [*OOPSLA & SLE 2009]
Natural and Flexible Error Recovery*
![Page 56: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/56.jpg)
Transformation with Stratego
![Page 57: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/57.jpg)
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
![Page 58: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/58.jpg)
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> |}
![Page 59: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/59.jpg)
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)
![Page 60: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/60.jpg)
origin tracking
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)
![Page 61: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/61.jpg)
Semantic Editor Services
editor-analyze: (ast, path, project-path) -> (ast2, errors, warnings, notes) with // ...
editor-complete-proposal : SimpleType(COMPLETION(_)) -> proposals where all-types := <get-all-types>; proposals := <map(type-name-to-proposal); flatten-list> all-types
editor-hover: (t@SimpleType(_), position, ast, path, project-path) -> <get-doc> <lookup-type> t2 where t2 := <lookup-node> (position, ast)
editor-resolve: (t@SimpleType(qid), position, ast, path, project-path) -> target where target := <ensure-origin(lookup-type|qid)> t
![Page 62: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/62.jpg)
Connect transformations to IDE
Editor Services Bindings
module MoBL-Builders
imports MoBL-Builders.generated
builders provider : include/mobl.jar observer : editor-analyze on save : generate-artifacts builder : "Show ATerm" = generate-aterm (openeditor) (realtime) (meta) builder : "Format code" = format-code (openeditor) (realtime) builder : "Desugar" = editor-desugar (openeditor) (realtime) (meta)
![Page 63: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/63.jpg)
Includes testing of the editor services [* OOPSLA 2011]
Integrated Language Definition Testing*
![Page 64: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/64.jpg)
http://researchr.org/search/publication/mobl+spoofax+webdsl
Software Language Design & Engineering
http://spoofax.org
http://mobl-lang.org
http://webdsl.org
http://researchr.org
http://eelcovisser.org
separation of concerns + linguistic integration
cross concern consistency checking
early detection of failures
Linguistic abstraction:capture software knowledge in
domain-specific languages
Language workbench: DSL design and implementation with less effort than
traditional language engineering
![Page 65: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/65.jpg)
behind the scenes
![Page 66: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/66.jpg)
var results = Task.all().list();for(var i = 0; i < results.length; i++) { alert(results[i].name);}
synchronous programming
![Page 67: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/67.jpg)
render page
query database and process
results
...
time
![Page 68: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/68.jpg)
render page
query database and process
results
...
timebrowser freeze
![Page 69: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/69.jpg)
render page
send query
...
process query result
...
time
![Page 70: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/70.jpg)
Task.all.list(function(results) { for(var i = 0; i < results.length; i++) { alert(results[i].name); } });...
asynchronous programming
![Page 71: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/71.jpg)
Task.all().list(function(results) { alert("Hello, "); });alert("world!");
breaks sequential execution assumption
![Page 72: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/72.jpg)
Task.all().list(function(results) { // make changes ... persistence.flush(function() { alert("Changes saved!"); });});
![Page 73: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/73.jpg)
continuation-passing styletransformation
![Page 74: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/74.jpg)
function displayLocationAndReturn() : Coordinates { var position = mobl::location::getPosition(); log("Lat: " + position.latitude); log("Long: " + position.longitude); return position;}
function displayLocationAndReturn(callback) { mobl.location.getPosition(function(position) { console.log("Lat: " + position.latitude); console.log("Long: " + position.longitude); callback(position); });};
![Page 75: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/75.jpg)
function displayLocationAndReturn() : Coordinates { var position = mobl::location::getPosition(); log("Lat: " + position.latitude); log("Long: " + position.longitude); return position;}
function displayLocationAndReturn(callback) { mobl.location.getPosition(function(position) { console.log("Lat: " + position.latitude); console.log("Long: " + position.longitude); callback(position); });};
![Page 76: Software Language Design & Engineering: Mobl & Spoofax](https://reader034.fdocuments.in/reader034/viewer/2022051313/5484cfc2b47959f10c8b4cd6/html5/thumbnails/76.jpg)
function displayLocationAndReturn() : Coordinates { var position = mobl::location::getPosition(); log("Lat: " + position.latitude); log("Long: " + position.longitude); return position;}
function displayLocationAndReturn(callback) { mobl.location.getPosition(function(position) { console.log("Lat: " + position.latitude); console.log("Long: " + position.longitude); callback(position); });};