SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Scaling declarative language specifications
to full-featured languages
and real-world applications1
Ted Kaminksi and Eric Van Wyk
University of Minnesota
SLS 2013, June 25, 2013, Cambridge
1
This work is partially supported by NSF Awards No. 0905581 and
1047961.
c Eric Van Wyk 1
Scaling up: languages
c Eric Van Wyk 2
Scaling up: users
c Eric Van Wyk 3
Scaling up: languages
One strategy:
identify a “core” language
new features translate down to core features
For example:
for-loop to an initializing assignment and while-loop
int x,y,z, to int x; int y; int z;,
Difficult question: Which features are part of the core?
c Eric Van Wyk 4
Implicit and explicit specification of semantics
Specify semantics
explictly, where desirable/needed
implicitly, via translation, where possible
ArrayList herd = ... ;
for (Goat g: herd) {
g.milk ();
}
language feature-specific
error messages, analysis
optimizations
from Java 1.5 translates to code in Java 1.4:
ArrayList herd = ... ;
for (Iterator it = herd.iterator(); it.hasNext();) {
Goat g = (Goat) it.next(); g.milk();
}
for byte code generation
c Eric Van Wyk 5
Forwarding
supports explicit and implicit (via translation)
specification of semantics
originated in Intentional Programming at MSR Redmond,
adapted to attribute grammars at Oxford [CC’02]
In attribute grammar terminology:
production define some attributes
construct a semantically equivalent syntax tree and
“forward” queries for undefined attributes to that tree
Similar to prototype or object inheritance, not class
inheritance.
c Eric Van Wyk 6
abstract production enhanced for
f::Stmt ::= ’for’ ’(’ t::Type id::Id ’:’ data::Expr ’)’
body::Stmt
{ f.errors = if isCollection || isArray then [ ]
else [ "Enhanced-for must iterate over " ++
"Collections or arrays." ];
data.env = addEnv( id, t.typerep, f.env ) ;
local attribute isCollection :: Boolean =
match( data.typerep, collectionType( ) ) ;
local attribute isArray :: Boolean =
match( data.typerep, arrayTypeRep( ) ) ;
forwards to if isCollection then forOverCollection
else if isArray then forOverArray
else skip() ;
local attribute forOverCollection :: Stmt =
... syntax tree of for-loop over a collection...
local attribute forOverArray :: Stmt =
... syntax tree of for-loop over an array...
}c Eric Van Wyk 7
Various uses
Name binding
production unboundVarRef
e::Expr ::= v::VarRef t
forwards to
production boundVarRef
e::Expr ::= v::VarRef t dcl::Decorated Dcl
operator overloading
generic addition
forwards to
type-specific addition (e.g. integer, matrix, ... )
c Eric Van Wyk 8
Scaling up: users
c Eric Van Wyk 9
Extensible Languages (Frameworks)
@MSR: Intentional Programming
@Minnesota: ableJ [ECOOP’07], ableP [SPIN’11]
pluggable domain-specific language extensions
domain-specific syntax, analysis, and optimization
composable, developed independently!
general purpose host language still available
Extension features translate down to host language
c Eric Van Wyk 10
class Demo {
int demoMethod ( ) {
List<List<Integer>> dlist ;
int T ;
int SELECT ;
connection c "jdbc:derby:/home/derby/db/testdb"
with table person [ person id INTEGER,
first name VARCHAR,
last name VARCHAR ] ,
table details [ person id INTEGER,
age INTEGER ] ;
Integer limit = 18 ;
ResultSet rs = using c query {
SELECT age, gender, last name
FROM person , details
WHERE person.person id = details.person id
AND details.age > limit } ;
Integer = rs.getInteger("age");
String gender = rs.getString("gender");
boolean b ;
b = table ( age > 40 : T * ,
gender == "M" : T F ) ;
}
}
• natural syntax
• semantic analysis
• composable extensions
• SQL queries
• non-null pointer
analysis
• tabular boolean
expressions
c Eric Van Wyk 11
Extensibility: safe composability








Non-null
pointer
analysis
SQL
queries
c Eric Van Wyk 12
Extensibility: safe composability
SQL
queries
Non-null
pointer
analysis
c Eric Van Wyk 13
Roles people play ...
1. host language designer
2. language extension designer
3. programmer
language extension user
c Eric Van Wyk 14
c Eric Van Wyk 15
Extensible languages require declarative
specifications
Composable language/extension specifications.
For composable (no glue code) extensions, forwarding is
needed.
These make extensible language possible, but don’t
esnure that the extensions will, in fact, compose.
modular analysis are needed.
c Eric Van Wyk 16
Building a parser from composed specifications.
... CFGH
∪∗
{CFGE1
, ..., CFGEn
}
∀i ∈ [1, n].isComposable(CFGH
, CFGEi
)∧
conflictFree(CFGH
∪ CFGEi
)
⇒ ⇒ conflictFree(CFGH
∪ {CFGE1
, ..., CFGEn
})
Monolithic analysis - not too hard, but not too useful.
Modular analysis - harder, but required [PLDI’09].
Non-commutative composition of restricted LALR(1)
grammars.
c Eric Van Wyk 17
Building an attribute grammar evaluator from composed
specifications.
... AGH
∪∗
{AGE1
, ..., AGEn
}
∀i ∈ [1, n].modComplete(AGH
, AGEi
)
⇒ ⇒ complete(AGH
∪ {AGE
1 , ..., AGE
n })
Monolithic analysis - not too hard, but not too useful.
Modular analysis - harder, but required [SLE’12a].
c Eric Van Wyk 18
c Eric Van Wyk 19
Future work
#include <sdtio.h>
int main() {
... bits of SAC ...
... stencil specifications ...
... computational geometry optimizations
robustness transformations ...
}
c Eric Van Wyk 20
Thanks for your attention.
Questions?
http://melt.cs.umn.edu
evw@cs.umn.edu
c Eric Van Wyk 21
E. Van Wyk, O. de Moor, K. Backhouse, and
P. Kwiatkowski.
Forwarding in attribute grammars for modular language
design.
In 11th Conf. on Compiler Construction (CC), volume
2304 of LNCS, pages 128–142. Springer-Verlag, 2002.
Eric Van Wyk, Lijesh Krishnan, August Schwerdfeger, and
Derek Bodin.
Attribute grammar-based language extensions for Java.
In Proc. of European Conf. on Object Oriented Prog.
(ECOOP), volume 4609 of LNCS, pages 575–599.
Springer-Verlag, 2007.
c Eric Van Wyk 21
Yogesh Mali and Eric Van Wyk.
Building extensible specifications and implementations of
promela with AbleP.
In Proc. of Intl. SPIN Workshop on Model Checking of
Software, volume 6823 of LNCS, pages 108–125.
Springer-Verlag, July 2011.
August Schwerdfeger and Eric Van Wyk.
Verifiable composition of deterministic grammars.
In Proc. of Conf. on Programming Language Design and
Implementation (PLDI), pages 199–210. ACM, June 2009.
Ted Kaminski and Eric Van Wyk.
Modular well-definedness analysis for attribute grammars.
In Proc. of Intl. Conf. on Software Language Engineering
(SLE), volume 7745 of LNCS, pages 352–371.
Springer-Verlag, September 2012.
c Eric Van Wyk 21
Lijesh Krishnan and Eric Van Wyk.
Termination analysis for higher-order attribute grammars.
In Proceedings of the 5th International Conference on
Software Language Engineering (SLE 2012), volume 7745
of LNCS, pages 44–63. Springer-Verlag, September 2012.
Lijesh Krishnan.
Composable Semantics Using Higher-Order Attribute
Grammars.
PhD thesis, University of Minnesota, Department of
Computer Science and Engineering, Minneapolis,
Minnesota, USA, 2012.
Available at
http://melt.cs.umn.edu/pubs/krishnan2012PhD/.
c Eric Van Wyk 21

Más contenido relacionado

La actualidad más candente

Programming languages vienna
Programming languages viennaProgramming languages vienna
Programming languages viennagreg_s
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming languagesanjay joshi
 
Cling the llvm based interpreter
Cling the llvm based interpreterCling the llvm based interpreter
Cling the llvm based interpreterRoberto Nogueira
 
C++ history session 00 history
C++ history session 00   historyC++ history session 00   history
C++ history session 00 historyArun Prakash
 
Migrating from Objective-C to Swift
Migrating from Objective-C to SwiftMigrating from Objective-C to Swift
Migrating from Objective-C to SwiftDominique Stranz
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming languagesanjay joshi
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#Sireesh K
 
XtremeDistil: Multi-stage Distillation for Massive Multilingual Models
XtremeDistil: Multi-stage Distillation for Massive Multilingual ModelsXtremeDistil: Multi-stage Distillation for Massive Multilingual Models
XtremeDistil: Multi-stage Distillation for Massive Multilingual ModelsSubhabrata Mukherjee
 
Brief introduction to the c programming language
Brief introduction to the c programming languageBrief introduction to the c programming language
Brief introduction to the c programming languageKumar Gaurav
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsClarkTony
 

La actualidad más candente (20)

Programming languages vienna
Programming languages viennaProgramming languages vienna
Programming languages vienna
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
 
C language introduction
C language introduction C language introduction
C language introduction
 
Cling the llvm based interpreter
Cling the llvm based interpreterCling the llvm based interpreter
Cling the llvm based interpreter
 
C som-programmeringssprog-bt
C som-programmeringssprog-btC som-programmeringssprog-bt
C som-programmeringssprog-bt
 
C/C++ History in few slides
C/C++ History in few slides C/C++ History in few slides
C/C++ History in few slides
 
C++ history session 00 history
C++ history session 00   historyC++ history session 00   history
C++ history session 00 history
 
Migrating from Objective-C to Swift
Migrating from Objective-C to SwiftMigrating from Objective-C to Swift
Migrating from Objective-C to Swift
 
C++ language
C++ languageC++ language
C++ language
 
Difference between c, c++ and java
Difference between c, c++ and javaDifference between c, c++ and java
Difference between c, c++ and java
 
History of c++
History of c++History of c++
History of c++
 
Understanding jvm
Understanding jvmUnderstanding jvm
Understanding jvm
 
presentation on C++ basics by prince kumar kushwaha
presentation on C++ basics by prince kumar kushwahapresentation on C++ basics by prince kumar kushwaha
presentation on C++ basics by prince kumar kushwaha
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#
 
XtremeDistil: Multi-stage Distillation for Massive Multilingual Models
XtremeDistil: Multi-stage Distillation for Massive Multilingual ModelsXtremeDistil: Multi-stage Distillation for Massive Multilingual Models
XtremeDistil: Multi-stage Distillation for Massive Multilingual Models
 
Brief introduction to the c programming language
Brief introduction to the c programming languageBrief introduction to the c programming language
Brief introduction to the c programming language
 
C vs c++
C vs c++C vs c++
C vs c++
 
Formalizing homogeneous language embeddings
Formalizing homogeneous language embeddingsFormalizing homogeneous language embeddings
Formalizing homogeneous language embeddings
 

Destacado

Future mathematicians.edu653
Future mathematicians.edu653Future mathematicians.edu653
Future mathematicians.edu653Janelle McIntosh
 
Miller Children’s to Hold iWalk…4 Kids Event in October
Miller Children’s to Hold iWalk…4 Kids Event in OctoberMiller Children’s to Hold iWalk…4 Kids Event in October
Miller Children’s to Hold iWalk…4 Kids Event in OctoberGary Fournier
 
Biodiverse - Rosauer talk @ iEvoBio conference June 2010
Biodiverse - Rosauer talk @ iEvoBio conference June 2010Biodiverse - Rosauer talk @ iEvoBio conference June 2010
Biodiverse - Rosauer talk @ iEvoBio conference June 2010Dan Rosauer
 
2007990026 류현규
2007990026 류현규2007990026 류현규
2007990026 류현규eunae jp
 
Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...
Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...
Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...NHS Improving Quality
 
교환학생 - 박상민
교환학생 - 박상민교환학생 - 박상민
교환학생 - 박상민종호 이
 
공동체활성화를 위한 도시농업네트워크
공동체활성화를 위한 도시농업네트워크공동체활성화를 위한 도시농업네트워크
공동체활성화를 위한 도시농업네트워크도시농업 네트워크
 
페이스북 기업 페이지 이용형태 조사보고서
페이스북 기업 페이지 이용형태 조사보고서페이스북 기업 페이지 이용형태 조사보고서
페이스북 기업 페이지 이용형태 조사보고서SCOTOSS
 
임베디드 시스템 찾기 + 모듈
임베디드 시스템 찾기 + 모듈임베디드 시스템 찾기 + 모듈
임베디드 시스템 찾기 + 모듈shinminkyung
 
Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...
Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...
Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...GJESM Publication
 
Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...
Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...
Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...IFPRI-WEAI
 
Acosta dante England? Britain? What?
Acosta dante England? Britain? What?Acosta dante England? Britain? What?
Acosta dante England? Britain? What?Dante Rodolfo Acosta
 
Spagic3 Presentation En
Spagic3 Presentation EnSpagic3 Presentation En
Spagic3 Presentation Enguest76d50b
 
Balancing Sticky Content with SEO
Balancing Sticky Content with SEOBalancing Sticky Content with SEO
Balancing Sticky Content with SEOemilywarn
 
Ldml application - public
Ldml   application - publicLdml   application - public
Ldml application - publicseanscon
 
10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H
10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H 10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H
10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H FURQAN M LODHI
 

Destacado (20)

Future mathematicians.edu653
Future mathematicians.edu653Future mathematicians.edu653
Future mathematicians.edu653
 
Miller Children’s to Hold iWalk…4 Kids Event in October
Miller Children’s to Hold iWalk…4 Kids Event in OctoberMiller Children’s to Hold iWalk…4 Kids Event in October
Miller Children’s to Hold iWalk…4 Kids Event in October
 
Biodiverse - Rosauer talk @ iEvoBio conference June 2010
Biodiverse - Rosauer talk @ iEvoBio conference June 2010Biodiverse - Rosauer talk @ iEvoBio conference June 2010
Biodiverse - Rosauer talk @ iEvoBio conference June 2010
 
2007990026 류현규
2007990026 류현규2007990026 류현규
2007990026 류현규
 
Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...
Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...
Edge Talk: 'Out of our boxes. Patients as agents of change' by Alison Cameron...
 
교환학생 - 박상민
교환학생 - 박상민교환학생 - 박상민
교환학생 - 박상민
 
공동체활성화를 위한 도시농업네트워크
공동체활성화를 위한 도시농업네트워크공동체활성화를 위한 도시농업네트워크
공동체활성화를 위한 도시농업네트워크
 
페이스북 기업 페이지 이용형태 조사보고서
페이스북 기업 페이지 이용형태 조사보고서페이스북 기업 페이지 이용형태 조사보고서
페이스북 기업 페이지 이용형태 조사보고서
 
임베디드 시스템 찾기 + 모듈
임베디드 시스템 찾기 + 모듈임베디드 시스템 찾기 + 모듈
임베디드 시스템 찾기 + 모듈
 
Power BI
Power BIPower BI
Power BI
 
Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...
Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...
Hazard assessment for a pharmaceutical mixture detected in the upper Tennesse...
 
Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...
Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...
Session 2a - Quisumbing and Malapit - Using the WEAI for analysis in differen...
 
Activeand passivevoicepp
Activeand passivevoiceppActiveand passivevoicepp
Activeand passivevoicepp
 
Acosta dante England? Britain? What?
Acosta dante England? Britain? What?Acosta dante England? Britain? What?
Acosta dante England? Britain? What?
 
LM 2
LM 2LM 2
LM 2
 
Open Data Journalism
Open Data JournalismOpen Data Journalism
Open Data Journalism
 
Spagic3 Presentation En
Spagic3 Presentation EnSpagic3 Presentation En
Spagic3 Presentation En
 
Balancing Sticky Content with SEO
Balancing Sticky Content with SEOBalancing Sticky Content with SEO
Balancing Sticky Content with SEO
 
Ldml application - public
Ldml   application - publicLdml   application - public
Ldml application - public
 
10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H
10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H 10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H
10 Non-Muslim author's who wrote a book on MUHAMMAD P.C.B.H
 

Similar a Scaling Language Specifications

Global DSL workshop slides
Global DSL workshop slidesGlobal DSL workshop slides
Global DSL workshop slidesericupnorth
 
Talk Lund University CS Department
Talk Lund University CS DepartmentTalk Lund University CS Department
Talk Lund University CS Departmentericupnorth
 
Domain specific languages and Scala
Domain specific languages and ScalaDomain specific languages and Scala
Domain specific languages and ScalaFilip Krikava
 
Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Eelco Visser
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesEelco Visser
 
Enhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyEnhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyChunhua Liao
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Challenges In Dsl Design
Challenges In Dsl DesignChallenges In Dsl Design
Challenges In Dsl DesignSven Efftinge
 
Slides:Coercion Quantification
Slides:Coercion QuantificationSlides:Coercion Quantification
Slides:Coercion QuantificationNingningXIE1
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N yearsRuslan Shevchenko
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
 
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraAllen Wirfs-Brock
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Anne Nicolas
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesSchwannden Kuo
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)lennartkats
 
Concepts of JetBrains MPS
Concepts of JetBrains MPSConcepts of JetBrains MPS
Concepts of JetBrains MPSVaclav Pech
 
Programming languages
Programming languagesProgramming languages
Programming languagesEelco Visser
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionEelco Visser
 

Similar a Scaling Language Specifications (20)

Global DSL workshop slides
Global DSL workshop slidesGlobal DSL workshop slides
Global DSL workshop slides
 
Talk Lund University CS Department
Talk Lund University CS DepartmentTalk Lund University CS Department
Talk Lund University CS Department
 
Domain specific languages and Scala
Domain specific languages and ScalaDomain specific languages and Scala
Domain specific languages and Scala
 
Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 
Enhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyEnhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through Ontology
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Challenges In Dsl Design
Challenges In Dsl DesignChallenges In Dsl Design
Challenges In Dsl Design
 
Slides:Coercion Quantification
Slides:Coercion QuantificationSlides:Coercion Quantification
Slides:Coercion Quantification
 
Scam 08
Scam 08Scam 08
Scam 08
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
 
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
 
E sampark with c#.net
E sampark with c#.netE sampark with c#.net
E sampark with c#.net
 
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
Kernel Recipes 2018 - 10 years of automated evolution in the Linux kernel - J...
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
 
Concepts of JetBrains MPS
Concepts of JetBrains MPSConcepts of JetBrains MPS
Concepts of JetBrains MPS
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
 

Último

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Scaling Language Specifications

  • 1. Scaling declarative language specifications to full-featured languages and real-world applications1 Ted Kaminksi and Eric Van Wyk University of Minnesota SLS 2013, June 25, 2013, Cambridge 1 This work is partially supported by NSF Awards No. 0905581 and 1047961. c Eric Van Wyk 1
  • 2. Scaling up: languages c Eric Van Wyk 2
  • 3. Scaling up: users c Eric Van Wyk 3
  • 4. Scaling up: languages One strategy: identify a “core” language new features translate down to core features For example: for-loop to an initializing assignment and while-loop int x,y,z, to int x; int y; int z;, Difficult question: Which features are part of the core? c Eric Van Wyk 4
  • 5. Implicit and explicit specification of semantics Specify semantics explictly, where desirable/needed implicitly, via translation, where possible ArrayList herd = ... ; for (Goat g: herd) { g.milk (); } language feature-specific error messages, analysis optimizations from Java 1.5 translates to code in Java 1.4: ArrayList herd = ... ; for (Iterator it = herd.iterator(); it.hasNext();) { Goat g = (Goat) it.next(); g.milk(); } for byte code generation c Eric Van Wyk 5
  • 6. Forwarding supports explicit and implicit (via translation) specification of semantics originated in Intentional Programming at MSR Redmond, adapted to attribute grammars at Oxford [CC’02] In attribute grammar terminology: production define some attributes construct a semantically equivalent syntax tree and “forward” queries for undefined attributes to that tree Similar to prototype or object inheritance, not class inheritance. c Eric Van Wyk 6
  • 7. abstract production enhanced for f::Stmt ::= ’for’ ’(’ t::Type id::Id ’:’ data::Expr ’)’ body::Stmt { f.errors = if isCollection || isArray then [ ] else [ "Enhanced-for must iterate over " ++ "Collections or arrays." ]; data.env = addEnv( id, t.typerep, f.env ) ; local attribute isCollection :: Boolean = match( data.typerep, collectionType( ) ) ; local attribute isArray :: Boolean = match( data.typerep, arrayTypeRep( ) ) ; forwards to if isCollection then forOverCollection else if isArray then forOverArray else skip() ; local attribute forOverCollection :: Stmt = ... syntax tree of for-loop over a collection... local attribute forOverArray :: Stmt = ... syntax tree of for-loop over an array... }c Eric Van Wyk 7
  • 8. Various uses Name binding production unboundVarRef e::Expr ::= v::VarRef t forwards to production boundVarRef e::Expr ::= v::VarRef t dcl::Decorated Dcl operator overloading generic addition forwards to type-specific addition (e.g. integer, matrix, ... ) c Eric Van Wyk 8
  • 9. Scaling up: users c Eric Van Wyk 9
  • 10. Extensible Languages (Frameworks) @MSR: Intentional Programming @Minnesota: ableJ [ECOOP’07], ableP [SPIN’11] pluggable domain-specific language extensions domain-specific syntax, analysis, and optimization composable, developed independently! general purpose host language still available Extension features translate down to host language c Eric Van Wyk 10
  • 11. class Demo { int demoMethod ( ) { List<List<Integer>> dlist ; int T ; int SELECT ; connection c "jdbc:derby:/home/derby/db/testdb" with table person [ person id INTEGER, first name VARCHAR, last name VARCHAR ] , table details [ person id INTEGER, age INTEGER ] ; Integer limit = 18 ; ResultSet rs = using c query { SELECT age, gender, last name FROM person , details WHERE person.person id = details.person id AND details.age > limit } ; Integer = rs.getInteger("age"); String gender = rs.getString("gender"); boolean b ; b = table ( age > 40 : T * , gender == "M" : T F ) ; } } • natural syntax • semantic analysis • composable extensions • SQL queries • non-null pointer analysis • tabular boolean expressions c Eric Van Wyk 11
  • 14. Roles people play ... 1. host language designer 2. language extension designer 3. programmer language extension user c Eric Van Wyk 14
  • 15. c Eric Van Wyk 15
  • 16. Extensible languages require declarative specifications Composable language/extension specifications. For composable (no glue code) extensions, forwarding is needed. These make extensible language possible, but don’t esnure that the extensions will, in fact, compose. modular analysis are needed. c Eric Van Wyk 16
  • 17. Building a parser from composed specifications. ... CFGH ∪∗ {CFGE1 , ..., CFGEn } ∀i ∈ [1, n].isComposable(CFGH , CFGEi )∧ conflictFree(CFGH ∪ CFGEi ) ⇒ ⇒ conflictFree(CFGH ∪ {CFGE1 , ..., CFGEn }) Monolithic analysis - not too hard, but not too useful. Modular analysis - harder, but required [PLDI’09]. Non-commutative composition of restricted LALR(1) grammars. c Eric Van Wyk 17
  • 18. Building an attribute grammar evaluator from composed specifications. ... AGH ∪∗ {AGE1 , ..., AGEn } ∀i ∈ [1, n].modComplete(AGH , AGEi ) ⇒ ⇒ complete(AGH ∪ {AGE 1 , ..., AGE n }) Monolithic analysis - not too hard, but not too useful. Modular analysis - harder, but required [SLE’12a]. c Eric Van Wyk 18
  • 19. c Eric Van Wyk 19
  • 20. Future work #include <sdtio.h> int main() { ... bits of SAC ... ... stencil specifications ... ... computational geometry optimizations robustness transformations ... } c Eric Van Wyk 20
  • 21. Thanks for your attention. Questions? http://melt.cs.umn.edu evw@cs.umn.edu c Eric Van Wyk 21
  • 22. E. Van Wyk, O. de Moor, K. Backhouse, and P. Kwiatkowski. Forwarding in attribute grammars for modular language design. In 11th Conf. on Compiler Construction (CC), volume 2304 of LNCS, pages 128–142. Springer-Verlag, 2002. Eric Van Wyk, Lijesh Krishnan, August Schwerdfeger, and Derek Bodin. Attribute grammar-based language extensions for Java. In Proc. of European Conf. on Object Oriented Prog. (ECOOP), volume 4609 of LNCS, pages 575–599. Springer-Verlag, 2007. c Eric Van Wyk 21
  • 23. Yogesh Mali and Eric Van Wyk. Building extensible specifications and implementations of promela with AbleP. In Proc. of Intl. SPIN Workshop on Model Checking of Software, volume 6823 of LNCS, pages 108–125. Springer-Verlag, July 2011. August Schwerdfeger and Eric Van Wyk. Verifiable composition of deterministic grammars. In Proc. of Conf. on Programming Language Design and Implementation (PLDI), pages 199–210. ACM, June 2009. Ted Kaminski and Eric Van Wyk. Modular well-definedness analysis for attribute grammars. In Proc. of Intl. Conf. on Software Language Engineering (SLE), volume 7745 of LNCS, pages 352–371. Springer-Verlag, September 2012. c Eric Van Wyk 21
  • 24. Lijesh Krishnan and Eric Van Wyk. Termination analysis for higher-order attribute grammars. In Proceedings of the 5th International Conference on Software Language Engineering (SLE 2012), volume 7745 of LNCS, pages 44–63. Springer-Verlag, September 2012. Lijesh Krishnan. Composable Semantics Using Higher-Order Attribute Grammars. PhD thesis, University of Minnesota, Department of Computer Science and Engineering, Minneapolis, Minnesota, USA, 2012. Available at http://melt.cs.umn.edu/pubs/krishnan2012PhD/. c Eric Van Wyk 21