Your SlideShare is downloading. ×
Onward presentation.en
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Onward presentation.en

421
views

Published on

Published in: Technology, Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
421
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Motivation Language Factories Language Components Case Study The Research Agenda Language Factories Tony Clark1 Laurence Tratt2 1 School of Computing Thames Valley University London, UK 2 Bournemouth University, UK Onward! 2009Tony Clark, Laurence Tratt Language Factories
  • 2. Motivation Language Factories Language Components Case Study The Research AgendaOutline 1 Motivation 2 Language Factories 3 Language Components 4 Case Study 5 The Research Agenda Tony Clark, Laurence Tratt Language Factories
  • 3. Motivation Language Factories Language Components Case Study The Research AgendaLanguage Horticulture ...a good programmer in these times does not just write programs. A good programmer builds a working vocabulary. In other words, a good programmer does language design, though not from scratch, but by building on the frame of a base language. ...from now on, a main goal in designing a language should be to plan for growth. Guy L. Steele, Jr. Growing a language, 1998 Tony Clark, Laurence Tratt Language Factories
  • 4. Motivation Language Factories Language Components Case Study The Research AgendaGrowing a Language Large structured languages grow... From little acorns... Tony Clark, Laurence Tratt Language Factories
  • 5. Motivation Language Factories Language Components Case Study The Research AgendaGrowing a Language Large structured languages grow... From little acorns... Tony Clark, Laurence Tratt Language Factories
  • 6. Motivation Language Factories Language Components Case Study The Research AgendaBut It Takes Too Long and is Difficult to Control Tony Clark, Laurence Tratt Language Factories
  • 7. Motivation Language Factories Language Components Case Study The Research AgendaDefining Languages is Hard Lots of interest in DSLs: malleable syntax and semantics. Using GPLs to implement DSLs is not the best way. DSL definition is a specialist activity. DSLs are a desire lacking a philosophy. Tony Clark, Laurence Tratt Language Factories
  • 8. Motivation Language Factories Language Components Case Study The Research AgendaCurrent Situation Languages are difficult to evolve. Languages evolve slowly: how long between major language versions? Technologies are evolving to help with this: Stratego XMF Converge MPS Oslo More needs to be done... Tony Clark, Laurence Tratt Language Factories
  • 9. Motivation Language Factories Language Components Case Study The Research AgendaHow Are Software Systems Designed? Components Reuse Interfaces Extension Change Analysis Tony Clark, Laurence Tratt Language Factories
  • 10. Motivation Language Factories Language Components Case Study The Research AgendaLanguage Factories - Research Agenda A component-based approach to the definition and construction of languages, tools. Language Factories aim to support: Reuse of common language components. Agile language engineering. Language refactoring. Language analysis including impact analysis. Product Lines for Languages Users: Language Factory Developers Language Factory Users Application Developers Application Users Tony Clark, Laurence Tratt Language Factories
  • 11. Motivation Language Factories Language Components Case Study The Research AgendaRealising Language Factories Different formalisms, tools, degrees of automation. Varying levels of precision: Virtual LFs: designed and partly implemented. Idealised LFs: language workbenches (Martin Fowler). Many shared of grey in between (e.g. componentized abstract syntax). Can be realised with current languages (with compromises). Tony Clark, Laurence Tratt Language Factories
  • 12. Motivation Language Factories Language Components Case Study The Research AgendaLanguage Components Abstract Syntax Single definition of a data type. Concrete Syntax(es) e.g. a context free grammar. Syntactic Mapping Concrete syntax(es) to abstract syntax. Semantic Aspect(s) Language meaning: Operational. Denotational. Types. Code Generation. Serialization. Tooling Composable editors, checkers, etc. Constraints Conditions on language use. Interfaces What is offered and what is required? Tony Clark, Laurence Tratt Language Factories
  • 13. Motivation Language Factories Language Components Case Study The Research AgendaAn Example Language component Landing_gear(height:int, speed:float) { stm { state Moving_Up state Moving_Down state Deployed state Stowed transition up from Deployed to Moving_Up height_change[height>500ft and speed>100kn/s] transition down from Stowed to Moving_Down deploy } } Tony Clark, Laurence Tratt Language Factories
  • 14. Motivation Language Factories Language Components Case Study The Research AgendaA Language Is Composed of Parts Given components: @ / Expr / Measurements ACComponent @ / StateMachine(Guards) / StateMachine + ACComponent(Body) / / Can combine and recombine: Expr Measurement @ / / ACComponent @ / / StateMachine Expr Tony Clark, Laurence Tratt Language Factories
  • 15. Motivation Language Factories Language Components Case Study The Research AgendaA Reusable Expression Language lang Expr: ast: Var(Str) | Add(Expr, Expr) | Num(Int) grammar: expr -> name:Id <Var(name)> | lhs:Expr ’+’ rhs:Expr <Add(lhs, rhs)> | num:Int <Num(num)> semantics java: Var(x) -> [j| ${x} |] Add(x, y) -> [j| ${java(x)}.plus(${java(y)}) |] Num(x) -> [j| new ExprInt(${x}) |] constraints: exists_class(ExprInt) exists_class(Expr) exists_static_method(Expr,plus) end Tony Clark, Laurence Tratt Language Factories
  • 16. Motivation Language Factories Language Components Case Study The Research AgendaA Reusable Expression Language lang Expr: ast: Var(Str) | Add(Expr, Expr) | Num(Int) grammar: expr -> name:Id <Var(name)> | lhs:Expr ’+’ rhs:Expr <Add(lhs, rhs)> | num:Int <Num(num)> semantics java: Var(x) -> [j| ${x} |] Add(x, y) -> [j| ${java(x)}.plus(${java(y)}) |] Num(x) -> [j| new ExprInt(${x}) |] constraints: exists_class(ExprInt) exists_class(Expr) exists_static_method(Expr,plus) end Tony Clark, Laurence Tratt Language Factories
  • 17. Motivation Language Factories Language Components Case Study The Research AgendaA Reusable Expression Language lang Expr: ast: Var(Str) | Add(Expr, Expr) | Num(Int) grammar: expr -> name:Id <Var(name)> | lhs:Expr ’+’ rhs:Expr <Add(lhs, rhs)> | num:Int <Num(num)> semantics eval(env): Var(x) -> lookup(env, x) Add(x, y) -> eval(x, env) + eval(y, env) Num(x) -> x semantics java: Var(x) -> [j| ${x} |] Add(x, y) -> [j| ${java(x)}.plus(${java(y)}) |] Num(x) -> [j| new ExprInt(${x}) |] constraints: exists_class(ExprInt) exists_class(Expr) exists_static_method(Expr,plus) Factories Tony Clark, Laurence Tratt Language
  • 18. Motivation Language Factories Language Components Case Study The Research AgendaA Reusable Expression Language lang Expr: ast: Var(Str) | Add(Expr, Expr) | Num(Int) grammar: expr -> name:Id <Var(name)> | lhs:Expr ’+’ rhs:Expr <Add(lhs, rhs)> | num:Int <Num(num)> semantics java: Var(x) -> [j| ${x} |] Add(x, y) -> [j| ${java(x)}.plus(${java(y)}) |] Num(x) -> [j| new ExprInt(${x}) |] constraints: exists_class(ExprInt) exists_class(Expr) exists_static_method(Expr,plus) end Tony Clark, Laurence Tratt Language Factories
  • 19. Motivation Language Factories Language Components Case Study The Research AgendaA Reusable Expression Language lang Expr: ast: Var(Str) | Add(Expr, Expr) | Num(Int) grammar: expr -> name:Id <Var(name)> | lhs:Expr ’+’ rhs:Expr <Add(lhs, rhs)> | num:Int <Num(num)> semantics java: Var(x) -> [j| ${x} |] Add(x, y) -> [j| ${java(x)}.plus(${java(y)}) |] Num(x) -> [j| new ExprInt(${x}) |] constraints: exists_class(ExprInt) exists_class(Expr) exists_static_method(Expr,plus) end Tony Clark, Laurence Tratt Language Factories
  • 20. Motivation Language Factories Language Components Case Study The Research AgendaRepresenting Measurements lang Measurement: ast: Ft(Float) | KnPerH(Float) | MiPerH(Float) grammar: measure -> dst:Float ’ft’ <Ft(dst) | dst:Float ’kn/h’ <KnPerH(dst)> | dst:Float ’mph’ <MiPerH(dst)> semantics java: Ft(x) -> [j| new ExprFeet(${x}) |] KnPerS(x) -> [j| new ExprKnPerH(${x}) |] MiPerS(x) -> [j| new ExprKnPerH(${x*0.869}) |] constraints: exists_class(ExprFeet) exists_class(ExprKnPerH) end Tony Clark, Laurence Tratt Language Factories
  • 21. Motivation Language Factories Language Components Case Study The Research AgendaLanguage Factories: The Research Agenda Need syntax reuse and composition. Need semantics (operational, translational, ...) reuse and composition. Need composable type systems. Need composable tools. Need language templates (components with parameters). Need LF meta-languages and type systems. Need LF workbenches. Tony Clark, Laurence Tratt Language Factories