Rascal: A DSL for SCAM · The SCAM domain Uses common... Data-structures Algorithms Nothing new!...
Transcript of Rascal: A DSL for SCAM · The SCAM domain Uses common... Data-structures Algorithms Nothing new!...
Rascal: A DSL for SCAMJurgen Vinju
Tijs van der StormPaul Klint
Amsterdam, The Netherlands
Hall of fameBob Fuhrer
Emilie BallandArnold Lankamp
Bas Basten
Tuesday, September 29, 2009
The complexity of bridging an analysis tool to a transformation tool shadows the complexity of the analyses and transformations themselves
[Vinju & Cordy Dagstuhl 2005]
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
Refactoring
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
RefactoringSlicing
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
RefactoringSlicing
Reverse Engineering
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
RefactoringSlicing
Reverse Engineering Compilation
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
RefactoringSlicing
Reverse Engineering Compilation
Restructuring
Tuesday, September 29, 2009
Every SCAM tool requires both “analysis” and “transformation”
features
RefactoringSlicing
Reverse Engineering Compilation
Restructuring
Static checking
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
TXL
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
TXLStrategoXT
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
TXLStrategoXT
Crocopat
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
TXLStrategoXT
Crocopat GROK
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
TXLStrategoXT
Crocopat GROK
ASF+SDF
Tuesday, September 29, 2009
Most language parametric SCAM tools are geared towards
either “analysis” or “transformation”
TXLStrategoXT
Crocopat GROK
ASF+SDF
RScript
Tuesday, September 29, 2009
Many great SCAM tools are implemented in a GPL
Tuesday, September 29, 2009
Many great SCAM tools are implemented in a GPL
A GPL allows fine-grained integration between
analysis and transformation
Tuesday, September 29, 2009
Many great SCAM tools are implemented in a GPL
A GPL allows fine-grained integration between
analysis and transformation
Tuesday, September 29, 2009
A DSL for SCAM?
That covers SCAM
That scales down and scales up
That is easier
Tuesday, September 29, 2009
The SCAM domain
Source Code
Models
Pictures
GenerationExtraction
FormalizationVisualization
Transformation
Conversion
Analysis
Tuesday, September 29, 2009
The SCAM domainUses common...
Data-structures
Algorithms
Nothing new! But still..
Synthesize into a DSL
Conceptually
Syntactically
Semantically
Source Code
Models
Pictures
GenerationExtraction
FormalizationVisualization
Transformation
Conversion
Analysis
Tuesday, September 29, 2009
The SCAM domainUses common...
Data-structures
Algorithms
Nothing new! But still..
Synthesize into a DSL
Conceptually
Syntactically
Semantically
Source Code
Models
Pictures
GenerationExtraction
FormalizationVisualization
Transformation
Conversion
Analysis Pattern Matching
Tuesday, September 29, 2009
Rascal has to scale down to make simple tasks short and easy to
experiment with
Tuesday, September 29, 2009
Rascal has to scale down to make simple tasks short and easy to
experiment with
Plain old REPL, no static type
errors
Tuesday, September 29, 2009
Rascal has to scale down to make simple tasks short and easy to
experiment with
Plain old REPL, no static type
errors
First regexps, then CFG’s
Tuesday, September 29, 2009
Rascal has to scale down to make simple tasks short and easy to
experiment with
Plain old REPL, no static type
errors
First regexps, then CFG’s
Complete & domain specific, expression language: visit, pattern matching,
relational calculus
Tuesday, September 29, 2009
Rascal has to scale down to make simple tasks short and easy to
experiment with
Plain old REPL, no static type
errors
First regexps, then CFG’s
Complete & domain specific, expression language: visit, pattern matching,
relational calculus
URI literals: files,
projects, SVN, ...
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Modules are statically
checked
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Modules are statically
checked
Immutable data
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Modules are statically
checked
Immutable dataCo-variant sub-types
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Modules are statically
checked
Immutable data h.o. parametric polymorphism, rank-1 and 2
Co-variant sub-types
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Modules are statically
checked
Immutable data
Efficient and fully typed
(de)serialization
h.o. parametric polymorphism, rank-1 and 2
Co-variant sub-types
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
Function-local type inference
Modules are statically
checked
Immutable data
Efficient and fully typed
(de)serialization
h.o. parametric polymorphism, rank-1 and 2
Co-variant sub-types
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
lexically scoped
backtracking
Function-local type inference
Modules are statically
checked
Immutable data
Efficient and fully typed
(de)serialization
h.o. parametric polymorphism, rank-1 and 2
Co-variant sub-types
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
lexically scoped
backtracking
Function-local type inference
Modules are statically
checked
Immutable data
Efficient and fully typed
(de)serialization
h.o. parametric polymorphism, rank-1 and 2
Co-variant sub-types
blaConcrete syntaxbla
bla
IDE support bla
blaVisualization support
bla
Tuesday, September 29, 2009
Rascal has to scale up to complex analysis and transformation algorithms that employ reuse of
(library) functionality and allow design for maintainability
lexically scoped
backtracking
Function-local type inference
Modules are statically
checked
Immutable data
Efficient and fully typed
(de)serialization
h.o. parametric polymorphism, rank-1 and 2
Co-variant sub-types
blaConcrete syntaxbla
bla
IDE support bla
blaVisualization support
bla
Tuesday, September 29, 2009
We have implemented Infer generic type arguments [Fuhrer et al. ECOOP2005]
on Generic Featherweight Java [Igarashi et al. TOPLAS2002]
The size of the Rascal code is equal to thesize of the formal definitions in the papers
Tuesday, September 29, 2009
Rascal
Analysis and manipulation are happily married.
We should think of them as one.
Tuesday, September 29, 2009
Rascal
Analysis and manipulation are happily married.
We should think of them as one.
http://www.meta-environment.org
Tuesday, September 29, 2009