Augmenting Type Inference with Lightweight Heuristics

Total Page:16

File Type:pdf, Size:1020Kb

Augmenting Type Inference with Lightweight Heuristics Augmenting Type Inference with Lightweight Heuristics Inauguraldissertation der Philosophisch-naturwissenschaftlichen Fakultät der Universität Bern vorgelegt von | downloaded: 29.9.2021 Nevena Lazarevic´ von Serbien Leiter der Arbeit: Prof. Dr. O. Nierstrasz Institut für Informatik Universität Bern Von der Philosophisch-naturwissenschaftlichen Fakultät angenommen. Der Dekan: Bern, 21.06.2017. Prof. Dr. Gilberto Colangelo https://doi.org/10.24442/boristheses.846 source: This dissertation can be downloaded from scg.unibe.ch. Copyright ©2017 by Nevena Lazarevic´ This work is licensed under the terms of the Creative Commons Attribution – Noncommercial-No Derivative Works 2.5 Switzerland license. The license is available at http://creativecommons.org/licenses/by-sa/2.5/ ch/ Attribution–ShareAlike To my parents who always support my every decision. To my husband who always understands me. Mojim roditeljima koji me uvek u svemu podržavaju. Mom suprugu koji uvek ima razumevanja za mene. Acknowledgements First of all, I would like to thank Oscar Nierstrasz, for giving me the opportunity to work as a part of the Software Composition Group. I am eternally thankful to him for guiding me through the PhD life, for encouraging the research I was doing, and for giving desperately needed advice whenever necessary. I really enjoyed being a member of SCG, and solving every one of the coffee puzzles! I am very grateful to Stéphane Ducasse, first and foremost for agreeing to be on my PhD committee, and for providing me with his comments on my work. I thank Gerhard Jäger for chairing the PhD committee. A big thank you to all of the guys from SCG, who shared their time with me. Thank you, Mircea, for making every day shiny, joyous and colourful, even when it poured like hell. :) Thank you, Claudio, for finding time to read my work numerous times, and especially for sharing the office with me for, hm, eight months. :) Thank you, Haidar, for being a good friend, giving me tips for my travels and singing with me. Thank you, Boris, for all of our discussions in Serbian. Thank you, Andrei, for always asking how my research is going. :) Thank you, Andrea, for always smiling and being positive. Thank you, Jan, for always having a calm word and a piece of advice. Thank you, Leonel, for your precious advice regarding my trips to Chile and Argentina. Thank you, Mohammad, for always forcing me to perform better, even when I did not believe it was possible. :) Thank you, Yuriy, for all the laugh during coffee breaks. Thank you, Manuel, for always being ready for a cup of coffee. I also thank Erwann for the advice he shared with me at the beginning of my PhD. And, thank you, Cédric and Oliver for being my officemates for a couple of months. I am very thankful to Iris for her huge help during my PhD journey, and all the nice chats we had at SCG. She made all the administrative stuff so easy! I also thank David Röthlisberger and Romain Robbes for allowing me to visit and work for a month in Chile. It was an incredible experience! i One thank you to Clément Béra, for his collaboration and help regarding some of the work presented in this thesis. I want to use this opportunity to thank my parents, who always believe in me and support me. I hope I made them proud. An enormous thank you to my husband for standing (by) me even when I was unbearable (who hasn’t been like that at least once during PhD?!), and for always giving me courage and support. I want to thank all of my friends from Caˇ cakˇ and Belgrade for always being there for me, and for helping home feel like home: Neda Niketic,´ Kaca´ Petrovic,´ Ana Gutic,´ Isidora Cpajak,ˇ Jelena Petronijevic,´ Jovana Pavlovic,´ Mladen Pavlovic,´ Jelena Ilic,´ Nina Radojiciˇ c,´ Ivana Milovic,´ Stefan Miškovic´ and Ðorde¯ Bojovic.´ Big thank you to all of my friends in Zürich for making Switzerland feel like home: Anja and Filip (and for all the board-games-playing weekends we had), Džimi and Alica, Markovic´ and Irena. I am very thankful to my friends in Paris, Igor and Alina, for making my every trip to Paris enjoyable and for making me wish to be a student there again. I thank all the people who directly, or indirectly, contributed to this thesis, and made it possible. Let the journey begin! Audaces fortuna iuvat. April 03, 2017 Nevena Lazarevi´c ii Abstract Static type information facilitates program comprehension and analy- sis. Yet, such information is absent in dynamically-typed languages, and that increases the time needed for software maintenance. Type inference algorithms may provide type information to developers, but in order to be fast and assist in development phase, they sacrifice the precision for speed. One of the biggest obstacles for their precision is polymorphism presence. In this thesis we first analyse the prevalence of polymorphism in object- oriented software, to assess the criticality it imposes on simple type infer- ence. We find that polymorphism is omnipresent in object-oriented code, and that static analysis in dynamically-typed languages is also hampered by the usage of cross-hierarchy polymorphism, i.e., duck typing. As this big obstacle for static code analysis cannot be bypassed, we propose the need for lightweight heuristics to tackle the problem of imprecision of simple type inference algorithms. Four lightweight heuristics are employed to improve the performance of two simple and fast type inference approaches. These heuristics are founded on the source code and run-time information that are easy to collect without interrupting the workflow of a developer. The heuristics are evaluated and compared with the underlying algo- rithms based on their inference time and precision. All of them show a significant improvement when compared to the basic algorithm. They in- troduce a negligible overhead on the inference time, thus we deem them usable during regular coding tasks. iii iv Contents 1 Introduction1 1.1 Thesis statement.......................5 1.2 Contributions........................6 1.2.1 A large-scale software study on the prevalence of polymorphism in statically and dynamically-typed languages......................6 1.2.2 Lightweight heuristics for improving simple type inference algorithms................7 1.3 Outline........................... 10 2 State of the art 11 2.1 Gradual typing....................... 11 2.2 Optional typing....................... 13 2.3 Static type inference.................... 14 2.4 Dynamic type inference................... 17 2.4.1 Code instrumentation................ 17 2.4.2 Inline caches.................... 18 2.5 Other techniques...................... 19 3 Study of polymorphism prevalence 21 3.1 Introduction......................... 21 3.2 Related Work........................ 26 3.3 Terminology......................... 27 3.4 Experimental Setup..................... 32 3.4.1 Data processing................... 33 3.4.2 Data analysis.................... 33 3.5 Experimental Results.................... 34 3.5.1 Implementing polymorphism............ 34 3.5.2 Using polymorphism................ 35 v 3.5.3 Cardinality of polymorphic message sends.... 37 3.5.4 Implementing duck typing............. 39 3.5.5 Using duck typing................. 40 3.6 Threats to Validity...................... 41 3.7 Discussion.......................... 43 3.8 Conclusion......................... 45 4 Static class usage frequency heuristics 47 4.1 Introduction......................... 47 4.2 Overview.......................... 49 4.3 Heuristics and Approaches................. 53 4.3.1 Terminology.................... 53 4.3.2 Heuristics...................... 57 4.3.3 Assigned types vs. selector types.......... 60 4.3.4 Approaches..................... 61 4.4 Evaluation.......................... 62 4.4.1 Class instantiation heuristic............ 64 4.4.2 Name occurrence heuristic............. 70 4.4.3 Comparison with EATI............... 71 4.5 Discussion and threats to validity.............. 74 4.6 Conclusion and future work................. 76 5 Mining inline caches for class usage 77 5.1 Introduction......................... 77 5.2 Gathering of dynamic type information.......... 79 5.2.1 Execution of message sends............ 79 5.2.2 Run-time type information gatherer built..... 80 5.3 Type inference algorithm.................. 81 5.3.1 Dynamic information................ 81 5.4 Evaluation.......................... 82 5.4.1 Inline caching type gathering............ 82 5.4.2 Projects used for evaluation............ 83 5.4.3 Overall results — Hierarchy-Based approach... 83 5.4.4 Difference between the basic algorithm and ICTI. 85 5.4.5 Not guessed variables............... 86 5.4.6 Position of the correct type............. 89 5.4.7 Overall results — Class-Based approach...... 90 5.5 Threats to validity...................... 91 5.6 Conclusion......................... 92 vi 6 Exploiting Type Hints in Method Argument Names 93 6.1 Introduction......................... 93 6.2 Motivation.......................... 95 6.3 Algorithm.......................... 98 6.3.1 The Cartesian Product Algorithm......... 98 6.3.2 Type hints from method argument names..... 102 6.3.3 Upgraded CPA — CPA∗ .............. 103 6.4 Implementation....................... 103 6.4.1 CPA......................... 103 6.4.2 Type Hints in Smalltalk.............. 104 6.5 Evaluation.......................... 106 6.5.1 Argument names without inferred type hint.... 110 6.6 Threats to validity...................... 112 6.7 Conclusion......................... 113 7 Conclusion 115 7.1 Contributions........................ 116 7.1.1
Recommended publications
  • Liste Von Programmiersprachen
    www.sf-ag.com Liste von Programmiersprachen A (1) A (21) AMOS BASIC (2) A# (22) AMPL (3) A+ (23) Angel Script (4) ABAP (24) ANSYS Parametric Design Language (5) Action (25) APL (6) Action Script (26) App Inventor (7) Action Oberon (27) Applied Type System (8) ACUCOBOL (28) Apple Script (9) Ada (29) Arden-Syntax (10) ADbasic (30) ARLA (11) Adenine (31) ASIC (12) Agilent VEE (32) Atlas Transformatikon Language (13) AIMMS (33) Autocoder (14) Aldor (34) Auto Hotkey (15) Alef (35) Autolt (16) Aleph (36) AutoLISP (17) ALGOL (ALGOL 60, ALGOL W, ALGOL 68) (37) Automatically Programmed Tools (APT) (18) Alice (38) Avenue (19) AML (39) awk (awk, gawk, mawk, nawk) (20) Amiga BASIC B (1) B (9) Bean Shell (2) B-0 (10) Befunge (3) BANCStar (11) Beta (Programmiersprache) (4) BASIC, siehe auch Liste der BASIC-Dialekte (12) BLISS (Programmiersprache) (5) Basic Calculator (13) Blitz Basic (6) Batch (14) Boo (7) Bash (15) Brainfuck, Branfuck2D (8) Basic Combined Programming Language (BCPL) Stichworte: Hochsprachenliste Letzte Änderung: 27.07.2016 / TS C:\Users\Goose\Downloads\Softwareentwicklung\Hochsprachenliste.doc Seite 1 von 7 www.sf-ag.com C (1) C (20) Cluster (2) C++ (21) Co-array Fortran (3) C-- (22) COBOL (4) C# (23) Cobra (5) C/AL (24) Coffee Script (6) Caml, siehe Objective CAML (25) COMAL (7) Ceylon (26) Cω (8) C for graphics (27) COMIT (9) Chef (28) Common Lisp (10) CHILL (29) Component Pascal (11) Chuck (Programmiersprache) (30) Comskee (12) CL (31) CONZEPT 16 (13) Clarion (32) CPL (14) Clean (33) CURL (15) Clipper (34) Curry (16) CLIPS (35)
    [Show full text]
  • A Metacircular Architecture for Runtime Optimisation Persistence Clément Béra
    Sista: a Metacircular Architecture for Runtime Optimisation Persistence Clément Béra To cite this version: Clément Béra. Sista: a Metacircular Architecture for Runtime Optimisation Persistence. Program- ming Languages [cs.PL]. Université de Lille 1, 2017. English. tel-01634137 HAL Id: tel-01634137 https://hal.inria.fr/tel-01634137 Submitted on 13 Nov 2017 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. Universit´edes Sciences et Technologies de Lille { Lille 1 D´epartement de formation doctorale en informatique Ecole´ doctorale SPI Lille UFR IEEA Sista: a Metacircular Architecture for Runtime Optimisation Persistence THESE` pr´esent´eeet soutenue publiquement le 15 Septembre 2017 pour l'obtention du Doctorat de l'Universit´edes Sciences et Technologies de Lille (sp´ecialit´einformatique) par Cl´ement B´era Composition du jury Pr´esident: Theo D'Hondt Rapporteur : Ga¨elThomas, Laurence Tratt Examinateur : Elisa Gonzalez Boix Directeur de th`ese: St´ephaneDucasse Co-Encadreur de th`ese: Marcus Denker Laboratoire d'Informatique Fondamentale de Lille | UMR USTL/CNRS 8022 INRIA Lille - Nord Europe Numero´ d’ordre: XXXXX i Acknowledgments I would like to thank my thesis supervisors Stéphane Ducasse and Marcus Denker for allowing me to do a Ph.D at the RMoD group, as well as helping and supporting me during the three years of my Ph.D.
    [Show full text]
  • The Future: the Story of Squeak, a Practical Smalltalk Written in Itself
    Back to the future: the story of Squeak, a practical Smalltalk written in itself Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay [Also published in OOPSLA ’97: Proc. of the 12th ACM SIGPLAN Conference on Object-oriented Programming, 1997, pp. 318-326.] VPRI Technical Report TR-1997-001 Viewpoints Research Institute, 1209 Grand Central Avenue, Glendale, CA 91201 t: (818) 332-3001 f: (818) 244-9761 Back to the Future The Story of Squeak, A Practical Smalltalk Written in Itself by Dan Ingalls Ted Kaehler John Maloney Scott Wallace Alan Kay at Apple Computer while doing this work, now at Walt Disney Imagineering 1401 Flower Street P.O. Box 25020 Glendale, CA 91221 [email protected] Abstract Squeak is an open, highly-portable Smalltalk implementation whose virtual machine is written entirely in Smalltalk, making it easy to debug, analyze, and change. To achieve practical performance, a translator produces an equivalent C program whose performance is comparable to commercial Smalltalks. Other noteworthy aspects of Squeak include: a compact object format that typically requires only a single word of overhead per object; a simple yet efficient incremental garbage collector for 32-bit direct pointers; efficient bulk- mutation of objects; extensions of BitBlt to handle color of any depth and anti-aliased image rotation and scaling; and real-time sound and music synthesis written entirely in Smalltalk. Overview Squeak is a modern implementation of Smalltalk-80 that is available for free via the Internet, at http://www.research.apple.com/research/proj/learning_concepts/squeak/ and other sites. It includes platform-independent support for color, sound, and image processing.
    [Show full text]
  • Towards Gradual Typing for Generics
    Towards Gradual Typing for Generics Lintaro Ina and Atsushi Igarashi Graduate School of Informatics, Kyoto University {ina,igarashi}@kuis.kyoto-u.ac.jp Abstract. Gradual typing, proposed by Siek and Taha, is a framework to combine the benefits of static and dynamic typing. Under gradual typing, some parts of the program are type-checked at compile time, and the other parts are type-checked at run time. The main advantage of gradual typing is that a programmer can write a program rapidly without static type annotations in the beginning of development, then add type annotations as the development progresses and end up with a fully statically typed program; and all these development steps are carried out in a single language. This paper reports work in progress on the introduction of gradual typing into class-based object-oriented programming languages with generics. In previous work, we have developed a gradual typing system for Feather- weight Java and proved that statically typed parts do not go wrong. After reviewing the previous work, we discuss issues raised when generics are introduced, and sketch a formalization of our solutions. 1 Introduction Siek and Taha have coined the term “gradual typing” [1] for a linguistic sup- port of the evolution from dynamically typed code, which is suitable for rapid prototyping, to fully statically typed code, which enjoys type safety properties, in a single programming language. The main technical challenge is to ensure some safety property even for partially typed programs, in which some part is statically typed and the rest is dynamically typed. The framework of gradual typing consists of two languages: the surface lan- guage in which programmers write programs and the intermediate language into which the surface language translates.
    [Show full text]
  • Safe, Fast and Easy: Towards Scalable Scripting Languages
    Safe, Fast and Easy: Towards Scalable Scripting Languages by Pottayil Harisanker Menon A dissertation submitted to The Johns Hopkins University in conformity with the requirements for the degree of Doctor of Philosophy. Baltimore, Maryland Feb, 2017 ⃝c Pottayil Harisanker Menon 2017 All rights reserved Abstract Scripting languages are immensely popular in many domains. They are char- acterized by a number of features that make it easy to develop small applications quickly - flexible data structures, simple syntax and intuitive semantics. However they are less attractive at scale: scripting languages are harder to debug, difficult to refactor and suffers performance penalties. Many research projects have tackled the issue of safety and performance for existing scripting languages with mixed results: the considerable flexibility offered by their semantics also makes them significantly harder to analyze and optimize. Previous research from our lab has led to the design of a typed scripting language built specifically to be flexible without losing static analyzability. Inthis dissertation, we present a framework to exploit this analyzability, with the aim of producing a more efficient implementation Our approach centers around the concept of adaptive tags: specialized tags attached to values that represent how it is used in the current program. Our frame- work abstractly tracks the flow of deep structural types in the program, and thuscan ii ABSTRACT efficiently tag them at runtime. Adaptive tags allow us to tackle key issuesatthe heart of performance problems of scripting languages: the framework is capable of performing efficient dispatch in the presence of flexible structures. iii Acknowledgments At the very outset, I would like to express my gratitude and appreciation to my advisor Prof.
    [Show full text]
  • Strongtalk Plan Prezentacji
    Elżbieta Bajkowska Strongtalk Plan prezentacji Czym jest Strongtalk Historia Strongtalk System typów w Strongtalk Podsumowanie Źródła Czym jest Strongtalk Składnia i semantyka Smalltalk’a-80 plus: Większa wydajność – najszybsza implementacja Smalltalk System typów – opcjonalny i przyrostowy; silny, statyczny system typów działający niezależnie od metody kompilacji (nie typowany kod Smalltalka wykonuje się równie szybko) Typowana biblioteka klas według Smalltalk Blue Book Historia Strongtalk Dwa równoległe i niezależne wątki rozwoju przyszłego systemu Strongtalk Zachodnie wybrzeże – prace grupy związanej z językiem Self nad innowacyjną maszyną wirtualną Wschodnie wybrzeże – prace nad systemem typów dla języka Smalltalk Historia Strongtalk Zachód – maszyna wirtualna Cel – poprawienie wydajności czysto obiektowego języka Self Satysfakcjonujące odśmiecanie Problem efektywnej kompilacji dla dynamicznie typowanego języka, używającego konstrukcji bloku gdzie wszystkie dane są obiektami (analogia do Smalltalk’a) - Urs Hoelzle Historia Strongtalk Wschód – system typów Dave Griswold i Gilad Bracha opracowują Strongtalk - (nazwa systemu wywodzi się od systemu typów) – konferencja OOPSLA ’93 Baza – biblioteki ParcPlace Smalltalk, nie odzwierciedlające w pełni hierarchii typów Strongtalka Zainteresowanie technologią grupy pracującej nad kompilatorem Self dla poprawienia wydajności Historia Strongtalk Połączenie technologii Animorphic Systems - Dave Griswold zaczyna współpracę z Urs’em Hoelzle (reszta grupy: Lars Bak, Gilad Bracha,
    [Show full text]
  • Type Feedback for Bytecode Interpreters Position Paper ICOOOLPS 2007
    Type Feedback for Bytecode Interpreters Position Paper ICOOOLPS 2007 Michael Haupt1, Robert Hirschfeld1, and Marcus Denker2 1 Software Architecture Group Hasso-Plattner-Institut University of Potsdam, Germany 2 Software Composition Group Institute of Computer Science and Applied Mathematics University of Berne, Switzerland michael.haupt,hirschfeld @hpi.uni-potsdam.de, [email protected] { } Abstract. This position paper proposes the exploitation of type feed- back mechanisms, or more precisely, polymorphic inline caches, for purely interpreting implementations of object-oriented programming languages. Using Squeak’s virtual machine as an example, polymorphic inline caches are discussed as an alternative to global caching. An implementation proposal for polymorphic inline caches in the Squeak virtual machine is presented, and possible future applications for online optimization are outlined. 1 Introduction Bytecode interpreters are small in size and comparatively easy to implement, but generally execute programs much less efficiently than just-in-time (JIT) compilers. Techniques like threaded interpretation [9, 11, 2] focus on speeding up bytecode interpretation itself, and caching [4, 5, 1] improves the performance of message sends—the most common operation in object-oriented software [7]. It is interesting to observe that, while threading mechanisms are used natu- rally to a varying degree in bytecode interpreter implementations, such systems usually employ only global caching to speed up dynamic method dispatch. A global cache is clearly beneficial with respect to overall performance. Still, it does not provide optimal support for polymorphic message send sites, and it does not allow for exploiting type information (we provide details on these issues in the following section). In our opinion, the employment of polymorphic inline caches (PICs) [5] instead can provide means for achieving significant speedups in bytecode interpreters while exhibiting only a moderate increase in memory footprint and implementation complexity.
    [Show full text]
  • Comparative Studies of Programming Languages; Course Lecture Notes
    Comparative Studies of Programming Languages, COMP6411 Lecture Notes, Revision 1.9 Joey Paquet Serguei A. Mokhov (Eds.) August 5, 2010 arXiv:1007.2123v6 [cs.PL] 4 Aug 2010 2 Preface Lecture notes for the Comparative Studies of Programming Languages course, COMP6411, taught at the Department of Computer Science and Software Engineering, Faculty of Engineering and Computer Science, Concordia University, Montreal, QC, Canada. These notes include a compiled book of primarily related articles from the Wikipedia, the Free Encyclopedia [24], as well as Comparative Programming Languages book [7] and other resources, including our own. The original notes were compiled by Dr. Paquet [14] 3 4 Contents 1 Brief History and Genealogy of Programming Languages 7 1.1 Introduction . 7 1.1.1 Subreferences . 7 1.2 History . 7 1.2.1 Pre-computer era . 7 1.2.2 Subreferences . 8 1.2.3 Early computer era . 8 1.2.4 Subreferences . 8 1.2.5 Modern/Structured programming languages . 9 1.3 References . 19 2 Programming Paradigms 21 2.1 Introduction . 21 2.2 History . 21 2.2.1 Low-level: binary, assembly . 21 2.2.2 Procedural programming . 22 2.2.3 Object-oriented programming . 23 2.2.4 Declarative programming . 27 3 Program Evaluation 33 3.1 Program analysis and translation phases . 33 3.1.1 Front end . 33 3.1.2 Back end . 34 3.2 Compilation vs. interpretation . 34 3.2.1 Compilation . 34 3.2.2 Interpretation . 36 3.2.3 Subreferences . 37 3.3 Type System . 38 3.3.1 Type checking . 38 3.4 Memory management .
    [Show full text]
  • Sindarin: a Versatile Scripting API for the Pharo Debugger
    Sindarin: A Versatile Scripting API for the Pharo Debugger Thomas Dupriez Guillermo Polito Steven Costiou Univ. Lille, CNRS, Centrale Lille, CNRS - UMR 9189 - CRIStAL, Univ. Inria, Univ. Lille, CNRS, Centrale Inria, UMR 9189 - CRIStAL Lille, Centrale Lille, Inria Lille, UMR 9189 - CRIStAL France France France [email protected] [email protected] [email protected] Vincent Aranega Stéphane Ducasse Univ. Lille, CNRS, Centrale Lille, Inria, Univ. Lille, CNRS, Centrale Inria, UMR 9189 - CRIStAL Lille, UMR 9189 - CRIStAL France France [email protected] [email protected] Abstract Studies and work on debugging acknowledge that main- Debugging is one of the most important and time consuming stream debuggers are not well adapted to several debugging activities in software maintenance, yet mainstream debuggers scenarios [3, 27, 31]. This has led to the appearance of new de- are not well-adapted to several debugging scenarios. This bugging techniques proposing to augment traditional interac- has led to the research of new techniques covering specific tive debuggers with, e.g., stateful breakpoints [4], control-flow families of complex bugs. Notably, recent research proposes aware breakpoints [5], object-centric breakpoints [10, 34], the to empower developers with scripting DSLs, plugin-based and automatic insertion of breakpoints based on dynamic execu- moldable debuggers. However, these solutions are tailored to tions [45], or declarative statements from the developer [21]. specific use-cases, or too costly for one-time-use scenarios. A line of research has also started to study scripting APIs to In this paper we argue that exposing a debugging scripting empower developers to implement debugging scripts adapted interface in mainstream debuggers helps in solving many chal- to their needs.
    [Show full text]
  • Static Analyses for Stratego Programs
    Static analyses for Stratego programs BSc project report June 30, 2011 Author name Vlad A. Vergu Author student number 1195549 Faculty Technical Informatics - ST track Company Delft Technical University Department Software Engineering Commission Ir. Bernard Sodoyer Dr. Eelco Visser 2 I Preface For the successful completion of their Bachelor of Science, students at the faculty of Computer Science of the Technical University of Delft are required to carry out a software engineering project. The present report is the conclusion of this Bachelor of Science project for the student Vlad A. Vergu. The project has been carried out within the Software Language Design and Engineering Group of the Computer Science faculty, under the direct supervision of Dr. Eelco Visser of the aforementioned department and Ir. Bernard Sodoyer. I would like to thank Dr. Eelco Visser for his past and ongoing involvment and support in my educational process and in particular for the many opportunities for interesting and challenging projects. I further want to thank Ir. Bernard Sodoyer for his support with this project and his patience with my sometimes unconvential way of working. Vlad Vergu Delft; June 30, 2011 II Summary Model driven software development is gaining momentum in the software engi- neering world. One approach to model driven software development is the design and development of domain-specific languages allowing programmers and users to spend more time on their core business and less on addressing non problem- specific issues. Language workbenches and support languages and compilers are necessary for supporting development of these domain-specific languages. One such workbench is the Spoofax Language Workbench.
    [Show full text]
  • Blossom: a Language Built to Grow
    Macalester College DigitalCommons@Macalester College Mathematics, Statistics, and Computer Science Honors Projects Mathematics, Statistics, and Computer Science 4-26-2016 Blossom: A Language Built to Grow Jeffrey Lyman Macalester College Follow this and additional works at: https://digitalcommons.macalester.edu/mathcs_honors Part of the Computer Sciences Commons, Mathematics Commons, and the Statistics and Probability Commons Recommended Citation Lyman, Jeffrey, "Blossom: A Language Built to Grow" (2016). Mathematics, Statistics, and Computer Science Honors Projects. 45. https://digitalcommons.macalester.edu/mathcs_honors/45 This Honors Project - Open Access is brought to you for free and open access by the Mathematics, Statistics, and Computer Science at DigitalCommons@Macalester College. It has been accepted for inclusion in Mathematics, Statistics, and Computer Science Honors Projects by an authorized administrator of DigitalCommons@Macalester College. For more information, please contact [email protected]. In Memory of Daniel Schanus Macalester College Department of Mathematics, Statistics, and Computer Science Blossom A Language Built to Grow Jeffrey Lyman April 26, 2016 Advisor Libby Shoop Readers Paul Cantrell, Brett Jackson, Libby Shoop Contents 1 Introduction 4 1.1 Blossom . .4 2 Theoretic Basis 6 2.1 The Potential of Types . .6 2.2 Type basics . .6 2.3 Subtyping . .7 2.4 Duck Typing . .8 2.5 Hindley Milner Typing . .9 2.6 Typeclasses . 10 2.7 Type Level Operators . 11 2.8 Dependent types . 11 2.9 Hoare Types . 12 2.10 Success Types . 13 2.11 Gradual Typing . 14 2.12 Synthesis . 14 3 Language Description 16 3.1 Design goals . 16 3.2 Type System . 17 3.3 Hello World .
    [Show full text]
  • Pharo by Example
    Pharo by Example Andrew P. Black Stéphane Ducasse Oscar Nierstrasz Damien Pollet with Damien Cassou and Marcus Denker Version of 2009-10-11 ii This book is available as a free download from http://PharoByExample.org. Copyright © 2007, 2008, 2009 by Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz and Damien Pollet. The contents of this book are protected under Creative Commons Attribution-ShareAlike 3.0 Unported license. You are free: to Share — to copy, distribute and transmit the work to Remix — to adapt the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. • For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page: creativecommons.org/licenses/by-sa/3.0/ • Any of the above conditions can be waived if you get permission from the copyright holder. • Nothing in this license impairs or restricts the author’s moral rights. Your fair dealing and other rights are in no way affected by the above. This is a human-readable summary of the Legal Code (the full license): creativecommons.org/licenses/by-sa/3.0/legalcode Published by Square Bracket Associates, Switzerland. http://SquareBracketAssociates.org ISBN 978-3-9523341-4-0 First Edition, October, 2009.
    [Show full text]