The Rascal Language Workbench Tijs van der Storm Paul Klint Jurgen Vinju et al. Tuesday, May 31, 2011
r Rascal Team o h t u a C W L Paul Jurgen Tijs Bob Klint Vinju v/d Storm Fuhrer P M I IBM I N R I A INRIA Tuesday, May 31, 2011
Credits “ G e n e r a How Tijs & I were drafted... t i o n o f I n t e r a c t i v e P r o g r a m m i n g E n v i r o n m e n t s ” Esprit: GIPE I & GIPE II (90’ s) ASF+SDF Meta-Environment (00’ s) Eclipse I DE M eta Tooling P latform (IMP) Rascal will be contributed to Eclipse.org in June 2011 Tuesday, May 31, 2011
Rascal application areas Source-to-source Repository Mining transformation D S L c o n Refactoring s t r u c t i o n Reverse engineering Static Analysis MDE Software Visualisation ... I D E c o n s t r u c t i o n Tuesday, May 31, 2011
IDE construction = Meta Programming + GUI Programming Tuesday, May 31, 2011
IDE construction = Meta Programming + GUI Programming Eclipse IMP Tuesday, May 31, 2011
IDE construction = Meta Programming Rascal + GUI Programming Eclipse IMP Tuesday, May 31, 2011
Meta Programming is about analysis and transformation of (models of) programs Tuesday, May 31, 2011
Domain Analysis for Rascal -Meta Programming- Transformation Source Code Extraction Generation Models Analysis Formalization Visualization Pictures Conversion Tuesday, May 31, 2011
Rascal’ s Paradigm (from the MDE perspective) all about textual languages a model is source code a context-free grammar is a meta model a parse tree is a model instance a model transformation is a source-to-source transformation patterns written in concrete syntax textual languages may be mapped to abstract languages Tuesday, May 31, 2011
Rascal’ s Paradigm (from the MDE perspective) all about abstract languages a model is data (adt, rel, set, map, int, str, loc) a rascal type is a meta model a value is a model instance model transformation is a function some details patterns are values with holes list, set, bag, map matching list, set, bag, map comprehension Tuesday, May 31, 2011
Tuesday, May 31, 2011
Design Principles (a.k.a. Requirements) Simple = Simple Scaling up and scaling down = d e c n a v d A Expressivity without magic e l b i s s e c c A One-stop-shop (integrated) Meta Open Programming = Immediate Programming Integration = Valuable REPL Tuesday, May 31, 2011
+ + l a r u d e c o r p Ingredients functional Familiar syntax & notation parse trees Immutable data s n o i t a l e r Pattern-based dispatch matching Domain specific data-types traversal General context-free grammars String templates modular Java back door to reuse third-party code typed IDE integration via Eclipse IMP Tuesday, May 31, 2011
Demo Outline First Entities & Instances languages Immediate IDE: highlighting, folding, error marking, ... Java and SQL generation Online checking and error marking Then modular extensions Packages: Source-to-source transformation Derived I: expression language extension Derived II: linking to host language using annotations Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Tuesday, May 31, 2011
Summary 4 languages 1+4 IDEs (Rascal’ s + Dynamically installed) 3 checkers 3 code generators to Java 1 SQL code generator 2 XML code generators Total lines of code: 950 LOC Tuesday, May 31, 2011
e s a b a Design Principles t a D o N No Coordination (a.k.a. Requirements) m s a r a g D i o N No Algorithms Scaling up and scaling down Expressivity without magic Just Control flow One-stop-shop (integrated) J u s t M a t c h i n g Open Just EBNF Immediate Just Tracing Just Trees J u s t P r o Just Relations fi l i n g Just Debugging Just IMP Tuesday, May 31, 2011
Other applications Infer Generic Type arguments on FGJ [SCAM 2009] LDTA tool challenge: Oberon-0 compiler in 4 levels [LDTA2011] Derric: DSL for CSI (Digital Forensics) [ICSE 2011] Visitor 2 Interpreter refactoring [TOOLS 2011] Student projects (Java analysis, SVN analysis, ...) Tuesday, May 31, 2011
Quality of Rascal S.W .O.T. [ S ] simple, powerful, immediate, integral [ W ] alpha/beta quality, slow [ O ] optimization, applications, collaboration, growing team [ T ] the feature creep Tuesday, May 31, 2011
Immediate future Applications in Software Analysis & Transformation Applications in DSL development and evaluation Move to Eclipse.org (next month) More grammarware (CASE for grammars) More source/model visualization import/ export Tuesday, May 31, 2011
Questions? http:/ /www.rascal-mpl.org http:/ /www.eclipse.org/imp http:/ /www.cwi.nl/sen1 Tuesday, May 31, 2011
Recommend
More recommend