Domain-Specific Languages Language Workbenches

Similar documents
Programming Modeling Two Worlds? Programmierung Modellierung Zwei Welten? und. and. Markus Voelter Independent/itemis

Variability differences among products in PL. Variability in PLE. Language Workbenches. Language Workbenches. Product Line Engineering

Language Extension and Composition with Language Workbenches

10 Thoughts 2 Demos * Discussions

A little History Domain Specific Languages Examples Tools Benefits A more theoretical View Programming and Modeling The LWES Project Bonus: Best

DSL Implementation. ... with language Workbenches. v1.1 Jan 16, Markus Voelter independent/itemis

Extending Java TM TM And Developing DSLs With JetBrains MPS Open- Source Language Workbench

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

Language engineering and Domain Specific Languages

CSSE 490 Model-Based Software Engineering: Domain Specific Language Introduction

Domain Specific Languages. Requirements (Engineering)

What are Requirements?

Using Scala for building DSL s

building DSLs with language workbenches

A conceptual framework for building good DSLs. Markus Voelter independent/itemis

Programming Languages

PEG-Based Language Workbench

ABAP DSL Workbench SAP TechED 2016

Xtext. Introduction and Real World Samples. Hendrik Bünder, itemis AG. itemis AG

Domain-Specific. Languages. Martin Fowler. AAddison-Wesley. Sydney Tokyo. With Rebecca Parsons

Practical DSL Design. Groovy Sydney Meetup May 4th, Peter Bell CEO/CTO SystemsForge

Introduction to Dependable Systems: Meta-modeling and modeldriven

Comparison and merge use-cases from practice with EMF Compare

INT NTION L. Domain Expert DSLs

An Evaluation of Domain-Specific Language Technologies for Code Generation

Testing DSLs How to test DSLs, their IDEs and Programs

building dsl s in static & dynamic languages

When Modeling meets Productivity. Sven Efftinge - itemis

Structured Data Representation for Multiple Programming Languages on Java VM

Projecting a Modular Future

Spoofax: An Extensible, Interactive Development Environment for Program Transformation with Stratego/XT

A Family of Languages for Architecture Description

MontiCore A Framework for DSL-Development

Christian Doppler Laboratory

Dániel Darvas Domain-specific languages (DSLs): what, how and when?

Eclipse Support for Using Eli and Teaching Programming Languages

Compositional Model Based Software Development

Comparing graphical DSL editors

Automated Testing of DSL Implementations

AADL Graphical Editor Design

Domain-Specific Languages for Composable Editor Plugins

BIG MODELS AN ALTERNATIVE APPROACH

with openarchitectureware

C++- und Ruby- und... Refactoring für Eclipse

Domain Specific - a Binary Decision?

Advanced Topics in Software Engineering (02265) Ekkart Kindler

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

Scala, Your Next Programming Language

SOA = Same Old Architecture?

Introduction to XML 3/14/12. Introduction to XML

Software Language Engineering of Architectural Viewpoints

Let s build. like they build. Markus Völter Bernd Kolb

Syntax and Grammars 1 / 21

DSL vs. Library API Shootout

Raising the Level of Development: Models, Architectures, Programs

Frustrated by all the hype?

What Every Xtext User Wished to Know Industry Experience of Implementing 80+ DSLs

DESIGN, EVOLUTION AND USE

The Next Generation of Eclipse: e4. Mike Milinkovich Executive Director Eclipse Foundation

JetBrains TeamCity Comparison

Tools to Develop New Linux Applications

Restful Interfaces to Third-Party Websites with Python

Implementation of F# language support in JetBrains Rider IDE

A Survey on Domain-Specific Languages in Robotics

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

What is a compiler? Xiaokang Qiu Purdue University. August 21, 2017 ECE 573

Building an IDE with Rascal

Portable Editor Services

Program generation for schema-based, typed data access

Elliotte Rusty Harold August From XML to Flat Buffers: Markup in the Twenty-teens

Speech 2 Part 2 Transcript: The role of DB2 in Web 2.0 and in the IOD World

Goals. Greater Geate Abstraction work on a higher level do more with less insulate from technology. Increase Value. Reduce lossiness.

Oracle Fusion Middleware 11g: Build Applications with ADF I

Graphical DSLs aka Domain-Specific Modelling

Domain Specific Languages. Product Line Engineering

Lessons learned from building Eclipse-based add-ons for commercial modeling tools

Automatized Generating of GUIs for Domain-Specific Languages

Eclipse Command Language

Turning a Suite of Modeling and Processing Tools Into a Production Grade System

Matrex Table of Contents

SERG. Spoofax: An Extensible, Interactive Development Environment for Program Transformation with Stratego/XT

Developing Web-Based Applications Using Model Driven Architecture and Domain Specific Languages

Model-Driven Engineering (MDE) Lecture 1: Metamodels and Xtext Regina Hebig, Thorsten Berger

Eclipse technology in IFMS Interface Management System

Dynamic Languages Toolkit. Presented by Andrey Tarantsov

Declarative. Contracts

The PISA Project A Model Driven Development case study

PSOA-to-TPTP Converter Documentation

The Script Bowl Featuring Groovy, JRuby, Jython and Scala. Raghavan Rags N. Srinivas CTO, Technology Evangelism

ADT: Eclipse development tools for ATL

10 - Integrated Development Environments

Towards Generating Domain-Specific Model Editors with Complex Editing Commands

Transition from EBNF to Xtext

Introduction to Eclipse

ECLIPSE MODELING PROJECT

Release Notes Tripolis Dialogue

A Strategy for Addressing the Needs of Advanced Scientific Computing Using Eclipse as a Parallel Tools Platform 1

MuseKnowledge Source Package Building

Seminar on Languages for Scientific Computing Aachen, 6 Feb Navid Abbaszadeh.

Software Factories Application within the ASE5 project

Transcription:

Software Engineering with and Domain-Specific Languages Language Workbenches Peter Friese Itemis peter.friese@itemis.de Markus Voelter Independent/itemis voelter@acm.org 1

Programming Languages C# Erlang C++ Python Ruby Java Groovy Fortran C Programming Languages are not expressive enough. C# Erlang C++ Python Ruby Java Groovy Fortran C 2

Programming Languages are not high-level enough. C# Erlang C++ Python Ruby Java Groovy Fortran C Programming Languages are not abstract enough. C# Erlang C++ Python Ruby Java Groovy Fortran C 3

Programming Languages are not domain-specific enough. C# Erlang C++ Python Ruby Java Groovy Fortran C Programming Languages are not enough. C# Erlang C++ Python Ruby Java Groovy Fortran C 4

Programming Languages Formats C# Erlang C++ Python Ruby Java json Groovy Fortran HTML yaml C CSS XML Programming Languages Formats Frameworks C# Erlang C++ Ruby Java json Python Django Groovy Fortran C JEE WPF JMS yaml CSS Rails lift HTML XML 5

Programming Languages Formats Frameworks are not enough. C# Erlang C++ Ruby Java json Python Django Groovy Fortran C JEE WPF JMS yaml CSS Rails lift HTML XML So? 6

Modeling Higher Level Domain Specific Concepts & Notations Code Generation Interpretation Solves the Problem! DSL 7

general purpose domain specific 8

tailor made effective++ specialized, limited used by experts together with other specialized tools But: 9

Different Worlds Programming Tools!= Modeling Tools Different Worlds Modeling Tool!= Modeling Tool 10

Different Worlds Mix Models and Programs Different Worlds Mix Models and Programs AST Navigation & Query 11

Different Worlds Mix Models and Programs AST Navigation & Query Integration of 3GL code Different Worlds Mix Models and Programs AST Navigation & Query Integration of 3GL code Code Constraints 12

Compare Domain Specific Notations and Abstractions Flexible! Limited! Frameworks Libraries (Fluent) APIs 13

Graphical Textual Forms Tables Flexible! Limited! Textual Trees Customize Generator or Interpreter Flexible! Limited! Reflection Meta Programs Open Compilers 14

Define custom Query or or Navigate Transform Flexible! Limited! AST APIs Static Analysis Regex Custom Validation or Error Checks Flexible! Limited! IDE plugins Static Analysis Open Compilers 15

Different Representations and Projections Flexible! Limited! Text is Text Code Folding Tree Views Visualizations Mixing and Composing Languages Flexible? Limited! Python-to-C-like Internal DSLs Embed-As-String Specific: LINQ 16

Scalable Usable IDE Support Brittle! Mature! Modeling Tools!? Debugging Refactoring Testing Brittle! Mature!? 17

Versioning Diff, Merge Branching Brittle! Mature! for some tools Gets some Jobs done. some people doubt that Gets the Job Done! everybody agrees 18

Why the difference? History? 19

Why the difference? It is time for 20

a Different Perspective Modeling Programming == == Programming Modeling 21

modeling == programming modeling == programming at different levels of abstraction from different viewpoints integrated! 22

modeling == programming with different degrees of domain-specificity with suitable notations with suitable expressiveness modeling == programming And always: precise and tool processable 23

Language Workbench (Martin Fowler) 24

Language Workbench (Martin Fowler) Freely define languages and integrate them Language Workbench (Martin Fowler)? use persistent abstract representation 25

Language Workbench (Martin Fowler) language ::= + schema + editors generators Language Workbench (Martin Fowler)? projectional editing 26

Language Workbench (Martin Fowler) persist incomplete or contradictory information Language Workbench (Martin Fowler) + powerful editing testing refactoring debugging groupware language definition implies IDE definition 27

Language Workbench (Martin Fowler) support for classical classical and+ modeling programming 28

Syntax primarily textual Syntax primarily textual with more symbols think: mathematics 29

Syntax primarily textual sometimes box&line style When a graphical notation is better, you can visualize. 30

Available Tooling Eclipse Xtext 31

Modeling as Programmig (Mostly) Textual Notations Concrete Syntax Storage (Fancy) ASCII Editors Read-Only Visualizations Custom Syntax Graphical Textual Symbolic++ 32

IDE Support Teamwork Debugging Custom Editors Complete Symbolic Integration Goto Def Find Refs Refactoring 33

Infrastructure Integration storage is text diff/merge with existing tools existing text tools work well! Language Composition Grammar composition with traditional parsers is tough! More advanced parsers currently resarch 34

Limited to Unicode how to handle non-character symbols Graphics!= Text two worlds separate editors per syntax/viewpoint models can still be ref integrated 35

http://eclipse.org/modeling 36

http://eclipse.org/xtext Xtext: Specify Grammar 37

Xtext: Generated Editor Xtext: Generated Editor Code Completion 38

Xtext: Generated Editor Syntax Coloring Custom Keyword Coloring Xtext: Generated Editor Realtime Constraint Validation 39

Xtext: Generated Editor Customizable Outlines Xtext: Generated Editor Code Folding 40

Xtext: Generated Editor Goto Definition Find References Cross-File References Model as EMF 41

DEMO I Building DSLs with Eclipse Xtext 42

Available Tooling Jetbrains Meta Programming System Parser-based text to tree to text 43

Projectional tree to text-lookalike (editor) to other trees **+ to text Programming as Modeling (Mostly) Graphical Notations Abstract Syntax Storage Projecting Editors Different editable views for model 44

Programming as Modeling (Mostly) Graphical Any kind of Notations Abstract Syntax Storage Projecting Editors Different editable views for model Language Composition There s no parsing. Unique Language Element Identity. Unlimted language composition. 45

Flexible Notations Textual } like ASCII box & line mathematical Graphical Semi-Graphical treated the same can be mixed Automatic IDE Extension tool support is inherent for languages build with projectional tools language definition implies IDE definition 46

Multiple Notations for the same concepts e.g. in different contexts or for different tasks Tree Editing is different from editing text try to make it feel like text takes some getting used to but: for more flexible notations a more general editing paradigm is needed 47

Infrastructure Integration storage is not text diff/merge must be in tool existing text tools don t work Proprietary Tools no standards no interop 48

licensed under Apache 2.0 released in Q2 2009 currently 1.1 RC1 49

Build new standalone DSLs Build new standalone DSLs Build DSLs that reuse parts of other languages 50

Build new standalone DSLs Build DSLs that reuse parts of other languages (MPS comes with BaseLanguage) extend base language Java++ Build new standalone DSLs Build DSLs that reuse parts of other languages (MPS comes with BaseLanguage) extend base language build DSLs that reuse parts of BaseLanguage Java++ 51

Language Extension Example Java + Extension Language Extension Example Old Java ReadWriteLock l = l.readlock().lock(); try { //code } finally { l.readlock().unlock(); } Java + Extension 52

Language Extension Example Old Java ReadWriteLock l = l.readlock().lock(); try { //code } finally { l.readlock().unlock(); } New Java + Extension ReadWriteLock l = lock (l) { //code } 53

Structure Editor Typesystem Generator Structure Editor Typesystem Generator 54

Structure Editor Typesystem Generator Structure Editor Typesystem Generator 55

Structure Editor Typesystem Generator Structure Editor Typesystem Generator 56

Structure Editor Typesystem Generator Structure Editor Typesystem Generator 57

Structure Editor Typesystem Generator Language Extension Example Result behaves like a native base language construct 58

Language Extension Example Result behaves like a native base language construct Language Extension Example Translated to regular Java code based on the generator package jaxdemo.sandbox.sandbox; import java.util.concurrent.locks.lock; public class DemoClass { private Lock lock; public DemoClass() { try { this.getlock().lock(); SharedResouce.instance().doSomething(); } finally { this.getlock().unlock(); } } } private Lock getlock() { return this.lock; } 59

DEMO II Building DSLs with JetBrains MPS 60

THE END. 61

62