1 Extending Java And Developing DSLs With Open Source Language Workbench JetBrains MPS Konstantin Solomatov JetBrains Lead Developer for JetBrains MPS.

Slides:



Advertisements
Similar presentations
Integrated Development Environments, Source Control Repositories, Automated Testing Tools, Bug Tracking, Code Analysis Tools, Build Tools, Project Hosting.
Advertisements

Developing Domain-Specific Languages for the JVM Travis Dazell Systems Architect Digi-Key Corporation.
Automated Test Design ™ © 2011 Conformiq, Inc. CONFORMIQ DESIGNER On ES v1.2.1 Stephan Schulz MBT Working Meeting/MTS#56, Göttingen.
Chapter 22 UML Tooks and UML as Blueprint Model-Driven Architecture (MDA) Object-Constraint Language (OCL)
INTERPRETER Main Topics What is an Interpreter. Why should we learn about them.
Interpreter for ZOOM-I Andrew Deren Initial Presentation - SE690 5/30/03
Software Reuse Building software from reusable components Objectives
1/18 CS 693/793 Lecture 09 Special Topics in Domain Specific Languages CS 693/793-1C Spring 2004 Mo, We, Fr 10:10 – 11:00 CH 430.
CS 330 Programming Languages 09 / 13 / 2007 Instructor: Michael Eckmann.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Programming Languages Structure
The RDF meta model: a closer look Basic ideas of the RDF Resource instance descriptions in the RDF format Application-specific RDF schemas Limitations.
Groovy & Grails Jean Barmash CTO, EnergyScoreCards.com
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
What Is a Factory Pattern?.  Factories are classes that create or construct something.  In the case of object-oriented code languages, factories construct.
(C) 2013 Logrus International Practical Visualization of ITS 2.0 Categories for Real World Localization Process Part of the Multilingual Web-LT Program.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
ANTLR.
Type-Directed, Whitespace-Delimited Parsing for Embedded DSLs Cyrus Omar School of Computer Science Carnegie Mellon University [GlobalDSL13] Benjamin ChungAlex.
Extensible Type-Driven Parsing for Embedded DSLs in Wyvern Cyrus Omar Benjamin Chung Darya Kurilova Ligia Nistor Alex Potanin (Victoria University of Wellington)
The Kotlin Programming Language
A Simplified Approach to Web Service Development Peter Kelly Paul Coddington Andrew Wendelborn.
WorkPlace Pro Utilities.
A Practical High Volume Software Product Line Peter Bell CEO/CTO SystemsForge ooPLSA ‘07 Peter Bell CEO/CTO SystemsForge ooPLSA ‘07.
Comp 311 Principles of Programming Languages Lecture 1 Course Overview and Culture Corky Cartwright August 25, 2008.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson.
Agenda 1. Introduction 2. Overview of SU-MoVal 3. OCL-based Model Validation 4. QVT-based Transformations 5. Demo of SU-MoVal 6. Conclusion and Future.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Ontology Engineering and Plugin Development with the NeOn Toolkit Plug-in Development for the NeOn Toolkit June 1st, 2008 Michael Erdmann, Peter Haase,
Vision The ultimate IDE/CASE tool should supports all steps in the software development process. Current tools perform only minimal semantic-level analysis.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Lesson 3 CDT301 – Compiler Theory, Spring 2011 Teacher: Linus Källberg.
DDI & Model-View-Controller: An Architectural Perspective Dennis Wegener, Matthäus Zloch, Thomas Bosch (GESIS) Dagstuhl,
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
BUILD ON THE POLYGLOT COMPILER FRAMEWORK MIHAL BRUMBULLI 7th Workshop “SEERE” Montenegro-Risan 9-14 September 2007 SimJ Programming Language.
Automated Transformation of Statements Within Evolving Domain Specific Languages Peter Bell CEO/CTO, SystemsForge 7th OOPSLA Workshop on Domain-Specific.
SIMO SIMulation and Optimization ”New generation forest planning system” Antti Mäkinen & Jussi Rasinmäki Dept. of Forest Resource Management.
Eclipse 24-Apr-17.
Sheet 1 DocEng’03, Grenoble, November 2003 Model Driven Architecture based XML Processing Ivan Kurtev, Klaas van den Berg University of Twente, the Netherlands.
Cross Language Clone Analysis Team 2 October 13, 2010.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
Domain Specific Models John D. McGregor M13S1. Tool development Eclipse is an environment intended as a basis for building software engineering tools.
GOSS iCM Forms Gary Ratcliffe. 2 Agenda Webinar Programme Form Groups Publish Multiple Visual Script Editor Scripted Actions Form Examples.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
The Spoofax Language Workbench Rules for Declarative specification of language and IDEs Lennart C. L. Kats and Eelco Visser Delft University of Technology.
Build Systems Presentation December 14, 2015 Noon-1pm Kathy Lee Simunich Bldg. 203/ D120 Brought to you by: Argonne Java.
Cross Language Clone Analysis Team 2 February 3, 2011.
Presented by: Elena C. Ciobanu Mihai V. Ciobanu Kuntal Ghosh
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
14 October 2002GGF6 / CGS-WG1 Working with CIM Ellen Stokes
CMSC 330: Organization of Programming Languages Operational Semantics.
Concept mining for programming automation. Problem ➲ A lot of trivial tasks that could be automated – Add field Patronim on Customer page. – Remove field.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Random Test Generation of Unit Tests: Randoop Experience
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
A Framework for Automated and Composable Testing of Component-based Services Miguel A. Jiménez, Ángela Villota, Norha M. Villegas, Gabriel Tamura, Laurence.
1 Budapest University of Technology and Economics Department of Measurement and Information Systems Budapest University of Technology and Economics Fault.
By: Chad Gallati, Melissa Plakyda, Jenny Wilkes References: /a-z_programming_languages_groovy/
Chapter 3 – Describing Syntax CSCE 343. Syntax vs. Semantics Syntax: The form or structure of the expressions, statements, and program units. Semantics:
A Detailed Introduction To Visual Studio.NET CRB Tech ReviewsCRB Tech Reviews introduces you to the world of Visual.
Introduction  Model contains different kinds of elements (such as hosts, databases, web servers, applications, etc)  Relations between these elements.
Chapter 13 Web Application Infrastructure
Introduction ITEC 420.
The architecture of the P416 compiler
CS1022 Computer Programming & Principles
Productivity Tools Extensions to NetBeans IDE that make life easier
Part of the Multilingual Web-LT Program
Parsing with IRONY Roman Ivantsov, MCSD
Presentation transcript:

1 Extending Java And Developing DSLs With Open Source Language Workbench JetBrains MPS Konstantin Solomatov JetBrains Lead Developer for JetBrains MPS Project

Agenda  Extending languages. Why bother?  Problems and solutions Composability Language support  MPS’ approach Idea behind it Hands-on demo  MPS & domain-specific languages 2

Why Bother?  Specific domains = specific entities  Drawbacks of general-purpose languages: Limited set of generic constructs Domains are described too verbosely Low code maintainability  Domain-specific extensions Higher abstraction level Higher maintainability 3

Implicit Language Extensions  Domain-specific constructs in Java: synchronized block in Java enhanced for in Java typesafe enums in Java  Desired constructs: closures yield better support for regexps whatever else you are missing 4

Language Extensions  Existing extensions Cover domain-specific needs Are built into existing languages  Further extensions Hard to integrate Too long to wait until JCP accepts them Risks of incompatibility 5

MPS DEMO Closure & UI Language samples. 6

Agenda  Extending Languages. Why bother?  Problems and Solutions Composability Language support  MPS’ Approach Idea behind it Hands-on Demo  MPS & Domain-Specific Languages 7

Composability Definition: Components are composable when they can be used together even if created by different parties 8

Composability Desired Goal Java Libraries  Hibernate  Spring  Joda Time Java Extensions  DB Language  DI Language  Dates Language 9

Composability Libraries vs. Extensions  Libraries are composable: Java + Hibernate=> OK Java + Spring => OK Java + Hibernate, Spring=> OK  Language extensions are not Java + extension A => OK Java + extension B => OK Java + extensions A, B=> possible ambiguity 10

Composability Grammar Ambiguity Sample With String Interpolation  Extension “A”: int resultsCount = ; string s = “Found ${resultCount} results”;  Extension “B”: int resultCount = ; string t = “Found {resultCount} results”;  “A” + “B” => ambiguity for the compiler: string a = “Account balance is ${balance}”; 11

Language Support Requirements  Generic infrastructure Abstract grammar Type system Compiler Etc.  IDE infrastructure Editor Error highlighting Refactoring Version control Etc. 12

Language Support Problems  Time- and resource-consuming task Complicated algorithms for processing code Highly qualified developers required  Resulting infrastructure composability Type systems to be compatible with different extensions Refactorings should support potential extensions Etc. 13

Existing Solutions Pros & Cons Composability Language Infrastructure LISPYesNo Internal DSLs in Ruby / Groovy YesNo XText FrameworkNoYes 14

Common Problem  Existing solutions provide: Eithercomposable language extensions Ora decent infrastructure Not both 15

Agenda  Extending Languages. Why bother?  Problems and Solutions Composability Language support  MPS’ Approach Idea behind it Hands-on Demo  MPS & Domain-Specific Languages 16

Our Solution to the Problem  JetBrains MPS Workbench for defining and extending languages IDE for new languages and extensions 17

Idea Behind It Text-based grammars lead to ambiguities Another approach needed MPS works with Abstract Syntax Tree directly 18

Idea Behind It Editing Abstract Syntax Tree  Former attempts Diagram-based editing Limited domain of application  MPS solution Keeps user in habitual environment Supports text-like editing 19

Idea Behind It Projectional Editor 20  Each node of a syntax tree has its projection in the MPS Editor

Idea Behind It Projectional Editor 21  Each node – in a dedicated cell  A node is shown in its text/symbol representation  Instantly synchronized editor and syntax tree

Idea Behind It Projection vs. Text  Text-like projectional editor  Has its pros & cons  Reasonable learning curve: approx. 2 weeks 22

MPS DEMO Projectional editor in use. 23

Idea Behind It Language Support  User-defined language infrastructure Abstract grammar Type system Editor Compiler Etc.  Programming assistance Completion Find usages Rename Etc. 24

Idea Behind It Existing Languages & Extensions  Java™ re-implemented with MPS + Extensions Collections language Dates language Closures language Regexp language Etc.  Language definition languages Implemented with themselves i.e. bootstrapped  Misc languages (XML, etc.) 25

Hands-On Demo Goal Java ReadWriteLock l = … l.readLock().lock(); try { //code } finally { l.readLock().unlock(); } Java + Extension ReadWriteLock l = … read (l) { //code } 26

Hands-On Demo Workflow  We will define Structure Editor Typesystem Generator 27

MPS DEMO Adding lock statement to Java 28

Agenda  Extending Languages. Why bother?  Problems and Solutions Composability Language support  MPS’ Approach Idea behind it Hands-on Demo  MPS & Domain-Specific Languages 29

Domain-Specific Languages  MPS suits nicely for creating DSLs  Common language parts can be reused (e.g., expression language)  You can embed general-purpose languages (e.g., Java) inside DSLs 30

Domain-Specific Languages Example 31

Existing Applications  YouTrack – bug tracking system Completely developed with MPS Used internally Beta program  Languages for Web Development DNQ Webr Spring language 32

Licensing/Pricing  Almost fully open-sourced  Apache 2.0 License MPS is absolutely FREE 33

Q & A 34

More info - MPS page - MPS blog 35

36 Konstantin Solomatov Lead Developer for JetBrains MPS Project Thank You