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

Similar documents
Domain-Specific Languages Language Workbenches

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

What are Requirements?

Programming Languages

Domain Specific Languages. Product Line Engineering

Domain Specific Languages. Requirements (Engineering)

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

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

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

Testing DSLs How to test DSLs, their IDEs and Programs

DESIGN, EVOLUTION AND USE

building DSLs with language workbenches

Using Scala for building DSL s

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

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

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

Markus Völter

ABAP DSL Workbench SAP TechED 2016

Language engineering and Domain Specific Languages

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

Introduction to Dependable Systems: Meta-modeling and modeldriven

Declarative. Contracts

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

Language Shapes (Architectural) Thought Markus Völter

INT NTION L. Domain Expert DSLs

Language Workbenches, Embedded Software and Formal Verification

An Evaluation of Domain-Specific Language Technologies for Code Generation

Compositional Model Based Software Development

Frustrated by all the hype?

Domain Specific - a Binary Decision?

SOA = Same Old Architecture?

Projecting a Modular Future

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

with openarchitectureware

openarchitectureware 4.1 An introduction

building dsl s in static & dynamic languages

AADL Graphical Editor Design

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

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

Automatized Generating of GUIs for Domain-Specific Languages

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

Comparing graphical DSL editors

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

CS Exam #1-100 points Spring 2011

Software Language Engineering of Architectural Viewpoints

A Family of Languages for Architecture Description

PEG-Based Language Workbench

Scala, Your Next Programming Language

BridgePoint Roadmap Possibilities

Structured Data Representation for Multiple Programming Languages on Java VM

DSL vs. Library API Shootout

Automated Testing of DSL Implementations

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

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

Assigns a number to 110,000 letters/glyphs U+0041 is an A U+0062 is an a. U+00A9 is a copyright symbol U+0F03 is an

Transition from EBNF to Xtext

Matrex Table of Contents

Christian Doppler Laboratory

Raising the Level of Development: Models, Architectures, Programs

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

Programming in Scala Second Edition

JRuby. A Ruby VM in Java jruby.sourceforge.net Charles Oliver Nutter, presenting

Tools to Develop New Linux Applications

CS1102: What is a Programming Language?

Syntax and Grammars 1 / 21

Introduction to Model Driven Engineering using Eclipse. Frameworks

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

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

Functional Programming Lecture 1: Introduction

Eclipse technology in IFMS Interface Management System

Defining Domain-Specific Modeling Languages

ADT: Eclipse development tools for ATL

Design Principles that Make the Difference

Domain-Specific Languages for Composable Editor Plugins

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

CSE341: Programming Languages Lecture 26 Course Victory Lap. Dan Grossman Spring 2016

Introduction to OpenArchitectureWare

Big forms with JSON schemas and Transcrypt. November 15th, 2018 Philippe Entzmann

The PISA Project A Model Driven Development case study

A Multi-layered Domain-specific Language for Stencil Computations

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

Comparison and merge use-cases from practice with EMF Compare

Whole Platform Foundation. The Long Way Toward Language Oriented Programming

BIG MODELS AN ALTERNATIVE APPROACH

x ide xml Integrated Development Environment Specifications Document 1 Project Description 2 Specifi fications

Functional Programming and the Web

A Domain-Specific Language for Cross- Platform Smartphone Application Development

When Modeling meets Productivity. Sven Efftinge - itemis

SOAPScript For squeaky-clean code, use SOAPScript Language Summary Bob Nisco Version 0.5 β

Dynamic Languages Toolkit. Presented by Andrey Tarantsov

Grading for Assignment #1

RubyMine, the most advanced Ruby and Rails IDE

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

DDI more than just an XML-metadata-standard. Marcel Hebing (DIW Berlin) Vancouver, April 2014

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

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

CSE450. Translation of Programming Languages. Lecture 11: Semantic Analysis: Types & Type Checking

Transcription:

und Programmierung Modellierung Zwei Welten? and Modeling Two Worlds? Markus Voelter Independent/itemis voelter@acm.org Markus Voelter Independent/itemis voelter@acm.org 1

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

Languages are not abstract enough. C# Erlang C++ Python Ruby Java Groovy Fortran C Languages are not domain-specific enough. C# Erlang C++ Python Ruby Java Groovy Fortran C Languages are not enough. C# Erlang C++ Python Ruby Java Groovy Fortran C Languages Formats C# Erlang C++ Python Ruby Java Groovy json Fortran HTML C yaml CSS XML Languages Formats Frameworks C# Erlang C++ Ruby Java json Python Django Groovy Fortran C JEE WPF JMS yaml CSS Rails lift HTML XML 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 3

So? Modeling Higher Level Domain Specific Concepts & Notations Code Generation Interpretation Solves the Problem! DSL general purpose domain specific tailor made effective++ specialized, limited used by experts together with other specialized tools 4

But: Different Worlds Tools!= Modeling Tools Modeling Modeling (Mostly) Textual Notations Concrete Syntax Storage (Fancy) ASCII Editors Read-Only Visualizations Modeling (Mostly) Graphical Notations Abstract Syntax Storage Projecting Editors Different editable views for model (Mostly) Textual Notations Concrete Syntax Storage (Fancy) ASCII Editors Read-Only Visualizations Why the difference? 5

History? Why the difference? It is time for a Different Perspective Modeling == == Modeling modeling == programming 6

modeling == programming at different levels of abstraction from different viewpoints integrated! modeling == programming with different degrees of domain-specificity with suitable notations with suitable expressiveness modeling == programming And always: precise and tool processable Language Workbench (Martin Fowler) Language Workbench (Martin Fowler) Freely define languages and integrate them 7

Language Workbench (Martin Fowler)? use persistent abstract representation Language Workbench (Martin Fowler) language ::= + schema + editors generators Language Workbench (Martin Fowler)? projectional editing Language Workbench (Martin Fowler) persist incomplete or contradictory information Language Workbench (Martin Fowler) + powerful editing testing refactoring debugging groupware language definition implies IDE definition Language Workbench (Martin Fowler) support for classical classical and+ modeling programming 8

Syntax primarily textual Syntax primarily textual with more symbols think: mathematics Syntax primarily textual sometimes box&line style When a graphical notation is better, you can visualize. 9

Available Tooling Eclipse Xtext Modeling as Programmig (Mostly) Textual Notations Concrete Syntax Storage (Fancy) ASCII Editors Read-Only Visualizations Custom Syntax Graphical Textual Symbolic++ IDE Support Teamwork Debugging Custom Editors Complete Symbolic Integration Goto Def Find Refs Refactoring Infrastructure Integration storage not text diff/merge with existing tools existing text work well! 10

Language Composition Limited to Unicode Grammar composition with traditional parsers is tough! More advanced parsers currently resarch how to handle non-character symbols Graphics!= Text two worlds separate editors per syntax/viewpoint models can still be ref integrated http://eclipse.org/modeling http://eclipse.org/xtext 11

Xtext: Specify Grammar Xtext: Generated Editor Xtext: Generated Editor Xtext: Generated Editor Code Completion Syntax Coloring Custom Keyword Coloring Xtext: Generated Editor Realtime Constraint Validation Xtext: Generated Editor Customizable Outlines 12

Xtext: Generated Editor Code Folding Xtext: Generated Editor Goto Definition Find References Cross-File References Model as EMF DEMO I Building DSLs with Eclipse Xtext Available Tooling Jetbrains Meta System 13

Parser-based text to tree to text Projectional tree to text-lookalike (editor) to other trees **+ to text as Modeling (Mostly) Graphical Notations Abstract Syntax Storage Projecting Editors Different editable views for model 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. Flexible Notations Textual } like ASCII box & line mathematical Graphical Semi-Graphical treated the same can be mixed 14

Automatic IDE Extension tool support is inherent for languages build with projectional tools language definition implies IDE definition 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 Infrastructure Integration storage is not text diff/merge must be in tool existing text tools don t work Proprietary Tools no standards no interop 15

Build new standalone DSLs licensed under Apache 2.0 released in Q2 2009 currently 1.1 RC1 Build new standalone DSLs Build DSLs that reuse parts of other languages 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 Language Extension Example Java + Extension (MPS comes with BaseLanguage) extend base language build DSLs that reuse parts of BaseLanguage Java++ 16

Language Extension Example Old Java ReadWriteLock l = l.readlock().lock(); try { //code } finally { l.readlock().unlock(); } Java + Extension Language Extension Example Old Java ReadWriteLock l = l.readlock().lock(); try { //code } finally { l.readlock().unlock(); } New Java + Extension ReadWriteLock l = lock (l) { //code } Structure Editor Typesystem Generator Structure Editor Typesystem Generator Structure Editor Typesystem Generator 17

Structure Editor Typesystem Generator Structure Editor Typesystem Generator Structure Editor Typesystem Generator Structure Editor Typesystem Generator Structure Editor Typesystem Generator Structure Editor Typesystem Generator 18

Language Extension Example Result behaves like a native base language construct 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; } } DEMO II Building DSLs with JetBrains MPS 19

A vision for Languages are not MODULAR enough. Languages are not COMPOSABLE enough. Languages are not CONFIGURABLE enough. Languages are not ADAPTABLE enough. Language Syntax is not FLEXIBLE enough. 20

Big Language? o a b n c m k L d e j f i g h with many first class concepts! Small Language? Modular Language L my L a b c d e f g h i j k l with a few, orthogonal and poweful concepts with many optional, composable concepts Modular Language Modular Language Like frameworks and libraries, Like frameworks and libraries, but with syntax and IDE support 21

Not a new idea Growing A Language (Guy L Steele) 22

Example Languages 23

24

25

26

(Seemingly) Simple Example Adding matrices to C in an embedded environment. Currently: Currently: 1 2 3 Declare Data Structures in XML Generate Headers Implement manually in C Matrices not supported in XML format and generator Currently: Tool team would have to do the extension a lot of work busy one central tool Currently: No real compiler support in the resulting C code type checks operator overloading generics (matrix<int>) matrix syntax? 27

Better Solution Better Solution Better Solution generic matrix and vector types real matrix and vector literals Better Solution Better Solution syntax highlights for vectors and matrices operator overloading 28

Better Solution Better Solution operator overloading static optimization symmetrical matrices identity matrix diagonal matrices math notation Better Solution a separate language module used only by those who really need it Available Tooling Intentional Software Domain Workbench 29

Commercial Product Eval available upon request Eval available upon request Pension Workbench Example Pension Workbench Example Text Editing Domain Insurance Mathematics Domain Pension Workbench Example Pension Workbench Example Pension Contract Rules Domain All in one Document 30

Pension Workbench Example Symbolically integrated THE END. THE END..coordinates web www.voelter.de email voelter@acm.org skype schogglad twitter @markusvoelter xing linkedin http://www.xing.com/profile/markus_voelter http://www.linkedin.com/pub/0/377/a31.coordinates web www.voelter.de email voelter@acm.org skype schogglad twitter @markusvoelter xing linkedin http://www.xing.com/profile/markus_voelter http://www.linkedin.com/pub/0/377/a31.coordinates web www.voelter.de email voelter@acm.org skype schogglad twitter @markusvoelter xing linkedin http://www.xing.com/profile/markus_voelter http://www.linkedin.com/pub/0/377/a31 31

.coordinates web www.voelter.de email voelter@acm.org skype schogglad twitter @markusvoelter xing linkedin http://www.xing.com/profile/markus_voelter http://www.linkedin.com/pub/0/377/a31 32