On Modularity and Performances of External Domain-Specific Language Implementations Manuel Leduc

Total Page:16

File Type:pdf, Size:1020Kb

On Modularity and Performances of External Domain-Specific Language Implementations Manuel Leduc On modularity and performances of external domain-specific language implementations Manuel Leduc To cite this version: Manuel Leduc. On modularity and performances of external domain-specific language implementa- tions. Software Engineering [cs.SE]. Université Rennes 1, 2019. English. NNT : 2019REN1S112. tel-02972666 HAL Id: tel-02972666 https://tel.archives-ouvertes.fr/tel-02972666 Submitted on 20 Oct 2020 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. THÈSE DE DOCTORAT DE L’UNIVERSITE DE RENNES 1 COMUE UNIVERSITE BRETAGNE LOIRE Ecole Doctorale N°601 Mathèmatique et Sciences et Technologies de l’Information et de la Communication Spécialité : Informatique Par Manuel LEDUC On modularity and performance of External Domain-Specific Language im- plementations Thèse présentée et soutenue à RENNES , le 18 Décembre 2019 Unité de recherche : Equipe DiverSE, IRISA Rapporteurs avant soutenance : Paul Klint, Professeur, CWI, Amsterdam, Pays-Bas Juan De Lara, Professeur, Université autonome de Madrid, Madrid, Espagne Composition du jury : Président : Olivier Ridoux, Professeur, Université de Rennes 1, Rennes, France Examinateurs : Nelly Bencomo, Lecturer in Computer Science, Aston University, Birmingham, Royaume-Uni Jean-Remy Falleri, Maître de conférences HDR, Université de Bordeaux, Bordeaux, France Gurvan Le Guernic, Ingénieur de recherche, DGA, Rennes, France Dir. de thèse : Benoît Combemale, Professeur, UT2J, Toulouse, France Co-dir. de thèse : Olivier Barais, Professeur, Université de Rennes 1, Rennes, France Invité Thomas Degueule, Chargé de Recherche, CWI, Amsterdam, Pays-Bas ACKNOWLEDGEMENT First of all, I would like to thank all the members of the jury for accepting to review my work. In particular, I wish to thank Professor Juan De Lara and Professor Paul Klint for thoroughly reviewing this report. Those three years have been a very intense and enriching experience. For that, I want to thank my advisors, Benoît Combemale and Olivier Barais. I also want to highlight the infinite energy and passion that they invest in their work. This has been an incredible thing to witness. I also want to thank Thomas, who had the patience to write with me and to be available to answer my numerous questions. You helped me untangle the puzzle that scientific writing is. Then, I want to thank Gurvan, who gave me an outside view of my research and helped me question my work. Continuing, I would like to thank the members of the SWAT team. It has been a pleasure to visit your team and to collaborate on the ALE project. And as a final note on the professional and scientific side, I want to thank the DiverSE team as a whole. I am impressed by the energy, creativity, and spirit of its members and I’m proud to have shared so many coffee breaks with you all. Moving to a more personal note, I first want to thank the “coureurs d’extrême” running club. The weekly training sessions have been an awesome way to clear my mind after work. The great advice and cheerfulness of everybody brought me from slow-paced 10k races to ultra-trails during the span of those three years. It goes without saying that I thank everybody from “Robidou” and my family. Your attentions have helped me through this challenge. Finally, my last acknowledgment goes to Flora. Three wonderful years, thank you for your infinite support and encouragements, even when you were more exhausted than I was. TABLE OF CONTENTS Table of Contents Introduction en français i Contexte de recherche ............................... i Énoncé du problème ............................... i Contributions ................................... iii Applications : Implémentations et Évaluations .................. iv 1 Introduction 1 1.1 Research Context .............................. 1 1.2 Problem Statement ............................. 2 1.3 Contributions ................................ 3 1.4 Implementations and Evaluations ...................... 4 1.5 Outline ................................... 5 1.6 List of Publications ............................. 7 1.6.1 Main Publications ......................... 7 1.6.2 Publications Under Minor Revision ................ 7 1.6.3 Other Publications ......................... 8 I Preliminaries 9 2 Background 11 2.1 Model-Driven Engineering ......................... 11 2.2 Software Languages ............................. 15 2.3 Software Language Engineering ...................... 17 2.3.1 Domain-Specific Language Specification ............. 18 2.3.2 Domain-Specific Language Services Implementation ....... 22 2.3.3 Language Workbenches ...................... 22 2.4 Summary .................................. 23 3 State of the Art 25 3.1 Context and Scope ............................. 25 3.2 Reuse in Software Language Engineering ................. 28 3.2.1 Syntax Reuse ............................ 29 3.2.2 Semantics Reuse .......................... 31 3.3 Runtime Performance Optimization in Software Language Engineering . 33 TABLE OF CONTENTS 3.4 Tool Support in Software Language Engineering.............. 35 3.5 Advancing the State of the Art ....................... 37 II Contributions 40 4 Language Reuse 43 4.1 The Language Extension Problem ..................... 43 4.1.1 From the Expression Problem to the Language Extension Problem 43 4.1.2 The Language Extension Problem ................. 45 4.1.3 The Language Extension Problem in Practice ........... 46 4.1.4 Wrap up of the Language Extension Problem ........... 47 4.2 Reusable Languages Motivation and Overview .............. 47 4.2.1 Reuse of a Finite State Machine Language by Extension ..... 47 4.2.2 Reuse of a Finite State Machine Language by Composition .... 48 4.2.3 On Language Module Interfaces .................. 49 4.2.4 Language Reuse Requirements ................... 50 4.2.5 Language Extension Overview ................... 51 4.2.6 Language Composition Overview ................. 52 4.2.7 Modular Language Reuse Discussion ............... 54 4.3 Reusable Language Implementation .................... 54 4.3.1 The REVISITOR Pattern ...................... 55 4.3.2 Modular Extension with REVISITORS ............... 58 4.3.3 Modular Composition with REVISITORS ............. 61 4.4 Conclusion on Language Reuse ....................... 68 5 Language Performance Optimization 71 5.1 Introduction to Language Performances .................. 71 5.2 Background ................................. 72 5.2.1 Graal and GraalVM ......................... 72 5.2.2 Truffle ................................ 73 5.3 DSL Design and Implementation ...................... 73 5.4 Automatic Generation of Truffle-based Interpreters ............ 74 5.4.1 Preliminary Results ......................... 75 5.4.2 Truffle-Compliant Object Model Implementation ......... 75 5.4.3 Truffle Boundaries ......................... 77 5.4.4 Discussion of Additional Truffle Optimizations .......... 78 5.5 Conclusion on Language Performance Optimization ............ 80 TABLE OF CONTENTS III Implementation and Evaluation 81 6 Technical Background 83 6.1 Introducing the ALE Metalanguage .................... 83 6.2 Benchmarking Setup ............................ 87 7 ALE Compiler for Language Reuse 89 7.1 The REVISITOR compiler .......................... 89 7.2 Language Extension Evaluation ...................... 92 7.2.1 Scenario ............................... 92 7.2.2 fUML with ALE .......................... 93 7.2.3 Performance Evaluation ...................... 94 7.3 Language Composition Evaluation ..................... 95 7.3.1 The IoT Case Study ........................ 95 7.3.2 Case Study Implementation .................... 96 7.3.3 Discussion ............................. 97 7.4 Conclusion on Modular Language Reuse .................. 99 8 ALE Compiler for Language Performance Optimization 101 8.1 The Truffle Compiler ............................ 101 8.2 Language Performance Evaluation ..................... 102 8.2.1 Benchmarked Languages and Programs .............. 102 8.2.2 Results ............................... 103 8.3 Conclusion on the Automatic Optimization of Language Performances .. 105 IV Conclusion and Perspectives 106 9 Conclusion and Perspectives 109 9.1 Conclusion ................................. 109 9.2 Perspectives ................................. 110 9.2.1 Reusability and Performance Tradeoff ............... 110 9.2.2 Automatic Domain Adaptation ................... 111 9.2.3 Safer Language Reuse ....................... 112 V Indexes 113 List of Figures 114 List of Tables 116 List of Listings 117 Bibliography 117 Abstract 141 TABLE OF CONTENTS ii INTRODUCTION EN FRANÇAIS Contexte de recherche Un challenge important de l’ingénierie logicielle est le développement et la maintenance de systèmes complexes. Des exemples récents de tels systèmes sont l’internet des objets ou les systèmes cyber-physiques. La conception de ces systèmes complexes implique de nombreux partie prenante, avec des points de vue variés et hétérogènes. Ce qui soulève de nombreux défis d’ingénierie. Par conséquent, le succès de la conception de systèmes complexes requière l’application de méthodes et d’outils d’ingénierie
Recommended publications
  • How to Develop Your Own Dsls in Eclipse Using Xtend and Xtext ?
    How to develop your own DSLs in Eclipse using Xtend and Xtext ? Daniel Strmečki | Software Developer 19.05.2016. BUSINESS WEB APPLICATIONS HOW TO DEVELOP YOUR OWN DSLS IN ECLIPSE USING XTEXT AND XTEND? Content 1. DSLs › What are DSLs? › Kinds of DSLs? › Their usage and benefits… 2. Xtend › What kind of language is Xtend? › What are its benefits compared to classic Java? 3. Xtext › What is a language development framework? › How to develop you own DSL? 4. Short demo 5. Conclusion 2 | 19.05.2016. BUSINESS WEB APPLICATIONS | [email protected] | www.evolva.hr HOW TO DEVELOP YOUR OWN DSLS IN ECLIPSE USING XTEXT AND XTEND? DSL acronym Not in a Telecommunications context: Digital Subscriber Line But in a Software Engineering context: Domain Specific Languages 3 | 19.05.2016. BUSINESS WEB APPLICATIONS | [email protected] | www.evolva.hr HOW TO DEVELOP YOUR OWN DSLS IN ECLIPSE USING XTEXT AND XTEND? Domain Specific Languages General-Purpose Languages (GPLs) › Languages broadly applicable across application domains › Lack specialized features for a particular domain › XML, UML, Java , C++, Python, PHP… Domain specific languages (DSLs) › Languages tailored to for an application in a specific domain › Provide substantial gains in expressiveness and ease of use in their domain of application › SQL, HTML, CSS, Logo, Mathematica, Marcos, Regular expressions, Unix shell scripts, MediaWiki, LaTeX… 4 | 19.05.2016. BUSINESS WEB APPLICATIONS | [email protected] | www.evolva.hr HOW TO DEVELOP YOUR OWN DSLS IN ECLIPSE USING XTEXT AND XTEND? Domain Specific Languages A novelty in software development › DSL for programming numerically controlled machine tools, was developed in 1957–1958 › BNF dates back to 1959 (M.
    [Show full text]
  • Expressive and Efficient Model Transformation with an Internal DSL
    Expressive and Efficient Model Transformation with an Internal DSL of Xtend Artur Boronat Department of Informatics, University of Leicester, UK [email protected] ABSTRACT 1 INTRODUCTION Model transformation (MT) of very large models (VLMs), with mil- Over the past decade the application of MDE technology in indus- lions of elements, is a challenging cornerstone for applying Model- try has led to the emergence of very large models (VLMs), with Driven Engineering (MDE) technology in industry. Recent research millions of elements, that may need to be updated using model efforts that tackle this problem have been directed at distributing transformation (MT). This situation is characterized by important MT on the Cloud, either directly, by managing clusters explicitly, or challenges [26], starting from model persistence using XMI serial- indirectly, via external NoSQL data stores. In this paper, we draw at- ization with the Eclipse Modeling Framework (EMF) [31] to scalable tention back to improving efficiency of model transformations that approaches to apply model updates. use EMF natively and that run on non-distributed environments, An important research effort to tackle these challenges was showing that substantial performance gains can still be reaped on performed in the European project MONDO [19] by scaling out that ground. efficient model query and MT engines, such as VIATRA[3] and We present Yet Another Model Transformation Language (YAMTL), ATL/EMFTVM [46], building on Cloud technology either directly, a new internal domain-specific language (DSL) of Xtend for defin- by using distributed clusters of servers explicitly, or indirectly, by ing declarative MT, and its execution engine.
    [Show full text]
  • Open Source and Third Party Documentation
    Open Source and Third Party Documentation Verint.com Twitter.com/verint Facebook.com/verint Blog.verint.com Content Introduction.....................2 Licenses..........................3 Page 1 Open Source Attribution Certain components of this Software or software contained in this Product (collectively, "Software") may be covered by so-called "free or open source" software licenses ("Open Source Components"), which includes any software licenses approved as open source licenses by the Open Source Initiative or any similar licenses, including without limitation any license that, as a condition of distribution of the Open Source Components licensed, requires that the distributor make the Open Source Components available in source code format. A license in each Open Source Component is provided to you in accordance with the specific license terms specified in their respective license terms. EXCEPT WITH REGARD TO ANY WARRANTIES OR OTHER RIGHTS AND OBLIGATIONS EXPRESSLY PROVIDED DIRECTLY TO YOU FROM VERINT, ALL OPEN SOURCE COMPONENTS ARE PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. Any third party technology that may be appropriate or necessary for use with the Verint Product is licensed to you only for use with the Verint Product under the terms of the third party license agreement specified in the Documentation, the Software or as provided online at http://verint.com/thirdpartylicense. You may not take any action that would separate the third party technology from the Verint Product. Unless otherwise permitted under the terms of the third party license agreement, you agree to only use the third party technology in conjunction with the Verint Product.
    [Show full text]
  • Handcrafting a Triple Graph Transformation System to Realize Round-Trip Engineering Between UML Class Models and Java Source Code
    Handcrafting a Triple Graph Transformation System to Realize Round-trip Engineering Between UML Class Models and Java Source Code Thomas Buchmann and Sandra Greiner Chair of Applied Computer Science I, University of Bayreuth, Universitätsstrasse 30, 95440, Bayreuth, Germany Keywords: Round-trip Engineering, Model-driven Development, Xtend, Triple Graph Transformation Systems. Abstract: Model transformations are a mandatory requirement for model-driven development, a software engineering discipline, which has become more and more popular during the last decade. Over the years, the concept of unidirectional model transformations and corresponding tool support reached maturity since these kind of transformations are widely used in model-driven engineering, mainly for forward engineering and code generation. In incremental and iterative software engineering processes, forward engineering may be too restrictive since it resembles waterfall-like processes. Thus, bidirectional transformations are required, which aim to provide support for (incrementally) transforming one or more source model to one or more target model and vice versa from only one transformation description. However, they seem to be rarely used in model- driven software development as adequate tool support is missing. On the other hand, programming languages nowadays provide support for higher-level features like closures or lambda expressions which allow to describe transformation patterns in a declarative way. In this paper, we present an approach for round-trip engineering between UML class models and Java source code, which is realized with a triple graph transformation system written in the Xtend programming language. 1 INTRODUCTION and accompanying tools have emerged (Czarnecki and Helsen, 2006). We observe tools, which sup- During the last few years, model-driven software en- port unidirectional batch transformations, e.g.
    [Show full text]
  • Xtend Programming Language Agenda
    Agile Software Development Produced Eamonn de Leastar ([email protected]) by Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie Xtend Programming Language Agenda • Subtitle 3 4 Features (1) • Extension methods - enhance closed types with new functionality • Lambda Expressions - concise syntax for anonymous function literals • ActiveAnnotations - annotation processing on steroids • Operator overloading - make your libraries even more expressive • Powerful switch expressions - type based switching with implicit casts • Multiple dispatch - a.k.a. polymorphic method invocation 5 Features (2) • Template expressions - with intelligent white space handling • No statements - everything is an expression • Properties - shorthands for accessing and defining getters and setter • Type inference - you rarely need to write down type signatures anymore • Full support for Java generics - including all conformance and conversion rules • Translates to Java not bytecode - understand what is going on and use your code for platforms such as Android or GWT 6 Hello World xtend java class HelloWorld public class HelloWorld { { def static void main(String[] args) public static void main(String[] args) { { println("Hello World") System.out.println("Hello World"); } } } } 7 Selected Key Features • Java Interoperability • Expressions • Annotations • Type Inference • Literals • @Data • Conversion Rules • Casts • Classes • Field access & method invocation • Constructors • Constructor call • Fields • Lambda Expressions • Methods • If expression • Override • switch Expression • Inferred return types • return expression 8 Java Interoperability 9 Type inference • Xtend, like Java, is a statically typed language. • It completely supports Java's type system, including the primitive types like int or boolean, arrays and all the Java classes, interfaces, enums and annotations that reside on the class path.
    [Show full text]
  • Xtext User Guide
    Xtext User Guide Xtext User Guide Heiko Behrens, Michael Clay, Sven Efftinge, Moritz Eysholdt, Peter Friese, Jan Köhnlein, Knut Wannheden, Sebastian Zarnekow and contributors Copyright 2008 - 2010 Xtext 1.0 1 1. Overview .................................................................................................................... 1 1.1. What is Xtext? ................................................................................................... 1 1.2. How Does It Work? ............................................................................................ 1 1.3. Xtext is Highly Configurable ................................................................................ 1 1.4. Who Uses Xtext? ................................................................................................ 1 1.5. Who is Behind Xtext? ......................................................................................... 1 1.6. What is a Domain-Specific Language ..................................................................... 2 2. Getting Started ............................................................................................................ 3 2.1. Creating a DSL .................................................................................................. 3 2.1.1. Create an Xtext Project ............................................................................. 3 2.1.2. Project Layout ......................................................................................... 4 2.1.3. Build Your Own Grammar ........................................................................
    [Show full text]
  • Type Errors for the IDE with Xtext and Xsemantics Perience and Contributes to the Adoption of That Language
    Open Comput. Sci. 2019; 9:52–79 Research Article Open Access Lorenzo Bettini* Type errors for the IDE with Xtext and Xsemantics https://doi.org/10.1515/comp-2019-0003 perience and contributes to the adoption of that language. Received June 29, 2018; accepted February 11, 2019 However, developing a compiler and an IDE for a language from scratch is usually time consuming. Language work- Abstract: Providing IDE support for a programming lan- benches, a term coined by Martin Fowler in 2005 [1], are guage or a DSL (Domain Specific Language) helps the users software development tools designed to easily implement of the language to be more productive and to have an im- languages together with their IDE support. Xtext [2] is one mediate feedback on possible errors in a program. Static of the most popular language workbench. Starting from a types can drive IDE mechanisms such as the content as- grammar definition Xtext generates a parser, an abstract sist to propose sensible completions in a given program syntax tree (AST), and typical IDE mechanisms. While the context. Types can also be used to enrich other typical IDE main target of Xtext is Eclipse, a language developed with parts such as the Outline and the Hovering pop-ups. In this Xtext can be easily ported to other IDEs and editors. Xtext paper, we focus on statically typed imperative languages, comes with good defaults for all the above artifacts, di- adopting some form of type inference. We present a few rectly inferred from the grammar definition, and the lan- general patterns for implementing efficient type systems, guage developer can easily customize them all.
    [Show full text]
  • Script Alapú Járműbusz-Szimuláció
    SZAKDOLGOZAT-FELADAT Sándi Tamás (SMNQCY) szigorló villamosmérnök hallgató részére Script alapú járműbusz-szimuláció Napjaink prémium kategóriás személyautóinak működésében közel száz elektronikus vezérlőegység (ECU) játszik szerepet. Ezek között a kommunikáció szabványos autóipari protokollokon zajlik (CAN, FlexRay, LIN). Az így kapott összetett elosztott rendszer fejlesztésének elengedhetetlen részét képezi a vezérlőegységek kimerítő tesztelése. A tesztelés során a tesztelendő alkatrész által elvárt kommunikációs jeleket szimuláljuk. A tesztszekvenciák előállítására rendelkezésre áll a vállalatnál egy saját fejlesztésű kommunikációs eszköz (Gateway). Az eszköz számos szolgáltatást nyújt a felhasználó felé (CAN, FlexRay és LIN kommunikációs csatornák, valamint GPIO és A/D portok). A hallgató feladata egy olyan Eclipse alapú szoftvereszköz elkészítése, melynek segítségével a felhasználó egy erre a célra definiált szkriptnyelvben fogalmazhatja meg a Gateway által szimulálandó bonyolult kommunikációs szekvenciákat. Az eszköznek képesnek kell lennie továbbá az elkészített szkript alapján a Gatewayen futtatható kód generálására, valamint a hardverre való letöltése után annak futtatására is. A hallgató feladatának a következőkre kell kiterjednie: • Gyűjtse össze a gyakori használati eseteket (use case analízis), majd ezek alapján definiáljon egy kényelmesen használható domainspecifikus nyelvet a felmerülő igények kielégítésére. A szkriptnek lehetőséget kell nyújtania eseményvezérelt szekvenciák megfogalmazására is (pl.: üzenetek megérkezésére,
    [Show full text]
  • Xtend User Guide
    Xtend User Guide September 10, 2014 Contents I. Getting Started 5 1. Introduction 6 2. Hello World 7 3. The Movies Example 9 3.1. The Data . .9 3.2. Parsing The Data . 10 3.3. Answering Some Questions . 11 3.3.1. Question 1 : What Is The Number Of Action Movies? . 11 3.3.2. Question 2 : What Is The Year The Best Movie From The 80's Was Released? . 12 3.3.3. Question 3 : What Is The The Sum Of All Votes Of The Top Two Movies?................................. 13 II. Reference Documentation 14 4. Java Interoperability 15 4.1. Type Inference . 15 4.2. Conversion Rules . 15 4.3. Interoperability with Java . 16 5. Classes and Members 17 5.1. Package Declaration . 17 5.2. Imports . 17 5.3. Class Declaration . 18 5.4. Constructors . 19 5.5. Fields . 19 5.6. Methods . 20 5.6.1. Abstract Methods . 20 5.6.2. Overriding Methods . 21 5.6.3. Declared Exceptions . 21 5.6.4. Inferred Return Types . 21 5.6.5. Generic Methods . 22 2 5.6.6. Operator Declarations . 22 5.6.7. Dispatch Methods . 23 5.6.8. Create Methods . 26 5.7. Annotations . 28 5.8. Extension Methods . 29 5.8.1. Extensions from the Library . 29 5.8.2. Local Extension Methods . 30 5.8.3. Extension Imports . 30 5.8.4. Extension Provider . 31 5.9. Interface Declaration . 32 5.10. Annotation Type Declaration . 32 5.11. Enum Type Declaration . 32 5.12. Nested Type Declarations . 32 6. Expressions 34 6.1.
    [Show full text]
  • Xtext Documentation.Pdf
    Xtext Documentation September 26, 2014 Contents I. Getting Started 9 1. 5 Minutes Tutorial 10 1.1. Creating A New Xtext Project . 10 1.2. Generating The Language Infrastructure . 10 1.3. Try The Editor . 11 1.4. Conclusion . 12 2. 15 Minutes Tutorial 14 2.1. Create A New Xtext Project . 14 2.2. Write Your Own Grammar . 16 2.3. Generate Language Artifacts . 19 2.4. Run the Generated IDE Plug-in . 20 2.5. Second Iteration: Adding Packages and Imports . 20 3. 15 Minutes Tutorial - Extended 27 3.1. Writing a Code Generator With Xtend . 29 3.2. Unit Testing the Language . 34 3.3. Creating Custom Validation Rules . 35 4. Five simple steps to your JVM language 37 4.1. Step One: Create A New Xtext Project . 38 4.2. Step Two: Write the Grammar . 38 4.3. Step Three: Generate Language Artifacts . 43 4.4. Step Four: Define the Mapping to JVM Concepts . 43 4.5. Step Five : Try the Editor! . 48 II. Seven JVM Languages Built With Xbase 50 5. Introduction 51 5.1. Write the Grammar . 51 5.2. Map to Java . 51 5.3. CAUTION: This is Provisional API . 52 5.4. Common Requirements . 52 5.5. Getting the Code . 53 2 5.6. A Short Xtend Primer . 53 6. Scripting Language 57 6.1. Overview . 57 6.2. Running the Example . 58 6.3. Grammar . 58 6.4. Translation to Java . 59 7. Build Language 61 7.1. Overview . 61 7.2. Running the Example . 62 7.3. Grammar . 62 7.4.
    [Show full text]
  • Kotlin Срещу Scala – Сравнителен Анализ
    Computer and communications engineering, Vol. 14, No. 1/2020 Kotlin срещу Scala – сравнителен анализ Петко Данов Резюме: Представен само преди няколко години, Kotlin е един от многото езици, които използват виртуалната машина на Java, но в този кратък период придобива популярност. Scala е чист обектно-ориентиран език за програмиране, обединяващ в себе си предимствата на високо мащабируемите функционални езици за програмиране. Целта на настоящия документ е да сравни структурно двата езика и да идентифицира предимствата и недостатъците на всеки от тях. Ключови думи: Котлин, Скала, Програмни езици Kotlin vs Scala – а comparative study Petko Danov Abstract: Introduced just a few years ago, Kotlin is one of many languages that use the Java virtual machine, but it is gaining popularity in this short period. Scala is a pure object-oriented programming language that combines the advantages of highly scalable functional programming languages. The purpose of this paper is to compare the two languages structurally and to identify the advantages and disadvantages of each. Key words: Kotlin; Scala; Programming languages. 1. INTRODUCTION component-based applications [4]. Scala uses the so- called "actor model" to maintain modern parallelism. The development of the Kotlin programming This programming language also supports the so- language was started in 2010 by Jet Brains. The first called "lazy evaluation". With the inclusion of macros, stable version was released in February 2016, and in Scala is also distinguished by the creation of complex May 2017, Google included Kotlin in Android Studio internal domain-specific DSL languages. Scala also 3.0. Although it uses a JVM, it can also be compiled supports first-order operations and allows the use of into JavaScript and machine code [1].
    [Show full text]
  • Xtend User Guide
    Xtend User Guide June 28, 2012 Contents I. Getting Started 5 1. Introduction 6 2. Hello World 7 3. The Movies Example 9 3.1. The Data . .9 3.2. Parsing The Data . 10 3.3. Answering Some Questions . 11 3.3.1. Question 1 : What Is The Number Of Action Movies? . 11 3.3.2. Question 2 : What Is The Year The Best Movie From The 80's Was Released? . 12 3.3.3. Question 3 : What Is The The Sum Of All Votes Of The Top Two Movies?................................. 13 II. Reference Documentation 14 4. Java Interoperability 15 4.1. Type Inference . 15 4.2. Conversion Rules . 15 4.3. Interoperability with Java . 16 5. Classes and Members 17 5.1. Package Declaration . 17 5.2. Imports . 17 5.3. Class Declaration . 18 5.4. Constructors . 19 5.5. Fields . 19 5.6. Methods . 20 5.6.1. Abstract Methods . 20 5.6.2. Overriding Methods . 20 5.6.3. Declared Exceptions . 21 5.6.4. Inferred Return Types . 21 5.6.5. Generic Methods . 22 2 5.6.6. Dispatch Methods . 22 5.7. Annotations . 26 5.8. Extension Methods . 26 5.8.1. Extensions From The Library . 27 5.8.2. Local Extension Methods . 28 5.8.3. Extension Imports . 28 5.8.4. Extension Fields . 28 6. Expressions 30 6.1. Literals . 30 6.1.1. String Literals . 30 6.1.2. Number Literals . 31 6.1.3. Boolean Literals . 31 6.1.4. Null Literal . 31 6.1.5. Type Literals . 31 6.2. Type Casts .
    [Show full text]