publications: - title: "Polymorphic embedding of DSLs" author: - name: "Christian Hofer" link: "http://www.daimi.au.dk/~chmh/" - name: "Klaus Ostermann" link: "http://www.informatik.uni-marburg.de/~kos/" - name: "Tillmann Rendel" link: "https://researchr.org/alias/tillmann-rendel" - name: "Adriaan Moors" link: "http://www.google.com" year: "2008" doi: "http://doi.acm.org/10.1145/1449913.1449935" abstract: "The influential pure embedding methodology of embedding domain-specific languages (DSLs) as libraries into a general-purpose host language forces the DSL designer to commit to a single semantics. This precludes the subsequent addition of compilation, optimization or domain-specific analyses. We propose polymorphic embedding of DSLs, where many different interpretations of a DSL can be provided as reusable components, and show how polymorphic embedding can be realized in the programming language Scala. With polymorphic embedding, the static type-safety, modularity, composability and rapid prototyping of pure embedding are reconciled with the flexibility attainable by external toolchains." links: doi: "http://doi.acm.org/10.1145/1449913.1449935" tags: - "programming languages" - "optimization" - "semantics" - "reusable components" - "Scala" - "reuse" - "DSL" - "programming" - "program optimization" - "domain-specific language" researchr: "https://researchr.org/publication/HoferORM08" cites: 31 citedby: 0 pages: "137-148" booktitle: "GPCE" kind: "inproceedings" key: "HoferORM08" - title: "Modular structural operational semantics" author: - name: "Peter D. Mosses" link: "https://pdmosses.github.io" year: "2004" doi: "http://dx.doi.org/10.1016/j.jlap.2004.03.008" abstract: "Modular SOS (MSOS) is a variant of conventional Structural Operational Semantics (SOS). Using MSOS, the transition rules for each construct of a programming language can be given incrementally, once and for all, and do not need reformulation when further constructs are added to the language. MSOS thus provides an exceptionally high degree of modularity in language descriptions, removing a shortcoming of the original SOS framework. After sketching the background and reviewing the main features of SOS, the paper explains the crucial differences between SOS and MSOS, and illustrates how MSOS descriptions are written. It also discusses standard notions of semantic equivalence based on MSOS. Appendix A shows how the illustrative MSOS rules given in the paper would be formulated in conventional SOS." links: doi: "http://dx.doi.org/10.1016/j.jlap.2004.03.008" tags: - "programming languages" - "semantics" - "rule-based" - " structural operational semantics" - "SOS" - "rules" - "reviewing" - "programming" - "operational semantics" - "incremental" researchr: "https://researchr.org/publication/Mosses-JLAP-2004" cites: 0 citedby: 0 journal: "jlp" volume: "60-61" pages: "195-228" kind: "article" key: "Mosses-JLAP-2004" - title: "Mirrors: design principles for meta-level facilities of object-oriented programming languages" author: - name: "Gilad Bracha" link: "https://researchr.org/alias/gilad-bracha" - name: "David Ungar" link: "http://research.sun.com/people/ungar/" year: "2004" doi: "http://doi.acm.org/10.1145/1028976.1029004" abstract: "We identify three design principles for reflection and metaprogramming facilities in object oriented programming languages. Encapsulation: meta-level facilities must encapsulate their implementation. Stratification: meta-level facilities must be separated from base-level functionality. Ontological correspondence: the ontology of meta-level facilities should correspond to the ontology of the language they manipulate. Traditional/mainstream reflective architectures do not follow these precepts. In contrast, reflective APIs built around the concept of mirrors are characterized by adherence to these three principles. Consequently, mirror-based architectures have significant advantages with respect to distribution, deployment and general purpose metaprogramming." links: doi: "http://doi.acm.org/10.1145/1028976.1029004" tags: - "programming languages" - "object-oriented programming" - "ontologies" - "rule-based" - "deployment" - "meta programming" - "ontology" - "meta-model" - "architecture" - "functional programming" - "language design" - "principles" - "programming" - "subject-oriented programming" - "Meta-Environment" - "reflection" - "design" - "feature-oriented programming" - "meta-objects" researchr: "https://researchr.org/publication/BrachaU04" cites: 0 citedby: 0 pages: "331-344" booktitle: "OOPSLA" kind: "inproceedings" key: "BrachaU04" - title: "Optimising Embedded DSLs Using Template Haskell" author: - name: "Sean Seefried" link: "https://researchr.org/alias/sean-seefried" - name: "Manuel M. T. Chakravarty" link: "https://researchr.org/alias/manuel-m.-t.-chakravarty" - name: "Gabriele Keller" link: "https://researchr.org/alias/gabriele-keller" year: "2004" doi: "http://springerlink.metapress.com/openurl.asp?genre=article&issn=0302-9743&volume=3286&spage=186" links: doi: "http://springerlink.metapress.com/openurl.asp?genre=article&issn=0302-9743&volume=3286&spage=186" tags: - "Haskell" - "DSL" researchr: "https://researchr.org/publication/SeefriedCK04" cites: 0 citedby: 0 pages: "186-205" booktitle: "GPCE" kind: "inproceedings" key: "SeefriedCK04" - title: "Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs" author: - name: "Tiark Rompf" link: "https://researchr.org/alias/tiark-rompf" - name: "Martin Odersky" link: "http://lampwww.epfl.ch/~odersky/" year: "2010" doi: "http://doi.acm.org/10.1145/1868294.1868314" links: doi: "http://doi.acm.org/10.1145/1868294.1868314" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/gpce/RompfO10" tags: - "code generation" - "compiler" - "DSL" - "systematic-approach" researchr: "https://researchr.org/publication/RompfO10" cites: 0 citedby: 0 pages: "127-136" booktitle: "GPCE" kind: "inproceedings" key: "RompfO10" - title: "Implicit Propagation in Structural Operational Semantics" author: - name: "Peter D. Mosses" link: "https://pdmosses.github.io" - name: "Mark J. New" link: "https://researchr.org/alias/mark-j.-new" year: "2009" doi: "http://dx.doi.org/10.1016/j.entcs.2009.07.073" abstract: "In contrast to a transition system specification in process algebra, a structural operational semantics (SOS) of a programming language usually involves auxiliary entities: stores, environments, etc. When specifying SOS rules, particular auxiliary entities often need to be propagated unchanged between premises and conclusions. The standard technique is to make such propagation explicit, using variables. However, referring to all entities that need to be propagated unchanged in each rule can be tedious, and it hinders direct reuse of rules in different language descriptions. This paper proposes a new interpretation of SOS rules, such that each auxiliary entity is implicitly propagated in all rules in which it is not mentioned. The main benefits include significant notational simplification of SOS rules and much-improved reusability. This new interpretation of SOS rules is based on the same foundations as Modular SOS, but avoids the notational overhead of grouping auxiliary entities together in labels. After motivating and explaining implicit propagation, the paper considers the foundations of SOS and Modular SOS specifications, and defines the meaning of SOS specifications with implicit propagation by translating them to Modular SOS. It then shows how implicit propagation can simplify various rules found in the SOS literature. Keywords: formal semantics; structural operational semantics; Modular SOS; modularity; reuse " links: doi: "http://dx.doi.org/10.1016/j.entcs.2009.07.073" tags: - "programming languages" - "semantics" - "rule-based" - "translation" - "meta programming" - "formal semantics" - " structural operational semantics" - "process algebra" - "SOS" - "reuse" - "rules" - "algebraic specification" - " algebra" - "programming" - "operational semantics" - "modular SOS" - "Meta-Environment" researchr: "https://researchr.org/publication/MossesN09" cites: 0 citedby: 0 journal: "ENTCS" volume: "229" number: "4" pages: "49-66" kind: "article" key: "MossesN09" - title: "Template meta-programming for Haskell" author: - name: "Tim Sheard" link: "http://web.cecs.pdx.edu/~sheard/" - name: "Simon L. Peyton Jones" link: "http://research.microsoft.com/en-us/people/simonpj/" year: "2002" doi: "http://doi.acm.org/10.1145/636517.636528" abstract: " We propose a new extension to the purely functional programming language Haskell that supports compile-time meta-programming. The purpose of the system is to support the algorithmic construction of programs at compile-time.The ability to generate code at compile time allows the programmer to implement such features as polytypic programs, macro-like expansion, user directed optimization (such as inlining), and the generation of supporting data structures and functions from existing data structures and functions.Our design is being implemented in the Glasgow Haskell Compiler, ghc. " links: doi: "http://doi.acm.org/10.1145/636517.636528" tags: - "programming languages" - "optimization" - "meta programming" - "data-flow language" - "meta-model" - "functional programming" - "polytypic programming" - "template meta-programming" - "language design" - "Haskell" - "macros" - "data-flow programming" - "data-flow" - "code generation" - "compiler" - "programming" - "program optimization" - "Meta-Environment" - "polytypic" - "design" - "meta-objects" researchr: "https://researchr.org/publication/SheardJ02" cites: 0 citedby: 0 journal: "SIGPLAN" volume: "37" number: "12" pages: "60-75" kind: "article" key: "SheardJ02" - title: "Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages" author: - name: "Terence John Parr" link: "http://www.cs.usfca.edu/~parrt/" year: "2010" doi: "http://pragprog.com/titles/tpdsl/language-implementation-patterns" abstract: "Learn to build configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. You don’t need a background in computer science—ANTLR creator Terence Parr demystifies language implementation by breaking it down into the most common design patterns. Pattern by pattern, you’ll learn the key skills you need to implement your own computer languages." links: doi: "http://pragprog.com/titles/tpdsl/language-implementation-patterns" tags: - "programming languages" - "design science" - "meta programming" - "data-flow language" - "pattern language" - "meta-model" - "interpreter" - "modeling language" - "language modeling" - "language design" - "data-flow programming" - "data-flow" - "source-to-source" - "e-science" - "ANTLR" - "DSL" - "programming" - "software languages" - "Meta-Environment" - "compilers" - "design" - "interpreters" - "open-source" - "domain-specific language" researchr: "https://researchr.org/publication/Parr%3A2010" cites: 0 citedby: 0 publisher: "The Pragmatic Bookshelf" kind: "book" key: "Parr:2010" - title: "Mixing source and bytecode: a case for compilation by normalization" author: - name: "Lennart C. L. Kats" link: "http://www.lclnet.nl/" - name: "Martin Bravenboer" link: "http://martin.bravenboer.name/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2008" doi: "http://doi.acm.org/10.1145/1449764.1449772" abstract: "Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation to the base language, supported by preprocessors and extensible compilers. However, various kinds of extensions require further adaptation of a base compiler's internal stages and components, for example to support separate compilation or to make use of low-level primitives of the platform (e.g., jump instructions or unbalanced synchronization). To allow for a more loosely coupled approach, we propose an open compiler model based on normalization steps from a high-level language to a subset of it, the core language. We developed such a compiler for a mixed Java and (core) bytecode language, and evaluate its effectiveness for composition mechanisms such as traits, as well as statement-level and expression-level language extensions. " links: doi: "http://doi.acm.org/10.1145/1449764.1449772" "technical report (pdf)": "http://www.lclnet.nl/publications/TUD-SERG-2008-030.pdf" "project home page": "http://www.strategoxt.org/Stratego/TheDryadCompiler" tags: - "compilation by normalization" - "rule-based" - "Java" - "synchronization" - "translation" - "meta-model" - "modeling language" - "Stratego/XT" - "language modeling" - "composition" - "constraints" - "source-to-source" - "C++" - "Dryad" - "security" - "compiler" - "Meta-Environment" - "extensible language" - "systematic-approach" - "open-source" - "Stratego" - "JavaFront" - "domain-specific language" researchr: "https://researchr.org/publication/KatsBV08" cites: 44 citedby: 3 pages: "91-108" booktitle: "OOPSLA" kind: "inproceedings" key: "KatsBV08" - title: "Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions" author: - name: "Martin Bravenboer" link: "http://martin.bravenboer.name/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2004" doi: "http://doi.acm.org/10.1145/1028976.1029007" abstract: "Application programmer's interfaces give access to domain knowledge encapsulated in class libraries without providing the appropriate notation for expressing domain composition. Since object-oriented languages are designed for extensibility and reuse, the language constructs are often sufficient for expressing domain abstractions at the semantic level. However, they do not provide the right abstractions at the syntactic level. In this paper we describe MetaBorg, a method for providing concrete syntax for domain abstractions to application programmers. The method consists of embedding domain-specific languages in a general purpose host language and assimilating the embedded domain code into the surrounding host code. Instead of extending the implementation of the host language, the assimilation phase implements domain abstractions in terms of existing APIs leaving the host language undisturbed. Indeed, MetaBorg can be considered a method for promoting APIs to the language level. The method is supported by proven and available technology, i.e. the syntax definition formalism SDF and the program transformation language and toolset Stratego/XT. We illustrate the method with applications in three domains: code generation, XML generation, and user-interface construction." links: doi: "http://doi.acm.org/10.1145/1028976.1029007" tags: - "programming languages" - "object-oriented programming" - "concrete object syntax" - "syntax definition" - "meta programming" - "assimilation" - "SDF" - "XML" - "XML Schema" - "Stratego/XT" - "transformation language" - "composition" - "MetaBorg" - "language design" - "reuse" - "code generation" - "subject-oriented programming" - "abstraction" - "Meta-Environment" - "extensible language" - "ASF+SDF" - "feature-oriented programming" - "concrete syntax" - "meta-objects" - "transformation" - "Stratego" - "program transformation" - "domain-specific language" researchr: "https://researchr.org/publication/BravenboerV04" cites: 51 citedby: 8 pages: "365-383" booktitle: "OOPSLA" kind: "inproceedings" key: "BravenboerV04" - title: "Reflecting Scala" author: - name: "Yohann Coppel" link: "https://researchr.org/alias/yohann-coppel" year: "2008" month: "January" abstract: "Object-oriented languages usually implement an API supporting metalevel operations such as reflection. However, reflection APIs generally do not follow the three design principle for reflection and meta-programming. These three principles specify that meta-level facilities must a) encapsulate their implementation (encapsulation); b) be separated from base-level functionality (stratification); and c) their ontology should correspond to the ontology of the language itself (ontological correspondence) . The Scala programming language does not have any specific API supporting meta-programming. However, since it is compiled into Java bytecode, it is compatible with the complete Java library. Consequently, one can use the Java reflection API in order to access meta-level informations about a Scala program. Anyhow, this approach presents important limitations and raises some usability problems. We introduce a new mirror based reflection API for the Scala programming language, following the three principles previously mentioned. This API also maintains an important separation between classes, seen as data structures, and types, more abstract elements." links: "pdf": "http://lampwww.epfl.ch/teaching/projects/archive/coppel_report.pdf" tags: - "programming languages" - "object-oriented programming" - "ontologies" - "rule-based" - "Scala" - "Java" - "completeness" - "meta programming" - "data-flow language" - "ontology" - "meta-model" - "functional programming" - "language design" - "data-flow programming" - "data-flow" - "C++" - "compiler" - "subject-oriented programming" - "Meta-Environment" - "data encapsulation" - "systematic-approach" - "feature-oriented programming" - "meta-objects" researchr: "https://researchr.org/publication/Coppel2008" cites: 0 citedby: 0 institution: "Laboratory for Programming Methods. Ecole Polytechnique Federale de Lausanne" type: "Semester Project Report" address: "Lausanne, Switzerland" kind: "techreport" key: "Coppel2008" - title: "Optimizing Data Structures in High-Level Programs" author: - name: "Tiark Rompf" link: "https://researchr.org/alias/tiark-rompf" - name: "Arvind K. Sujeeth" link: "https://researchr.org/alias/arvind-k.-sujeeth" - name: " Nada Amin" link: "https://researchr.org/alias/nada-amin" - name: "Kevin J. Brown" link: "https://researchr.org/alias/kevin-j.-brown" - name: "Vojin Jovanovic" link: "https://researchr.org/alias/vojin-jovanovic" - name: "HyoukJoong Lee" link: "https://researchr.org/alias/hyoukjoong-lee" - name: "Manohar Jonnalagedda" link: "https://researchr.org/alias/manohar-jonnalagedda" - name: "Kunle Olukotun" link: "https://researchr.org/alias/kunle-olukotun" - name: "Martin Odersky" link: "http://lampwww.epfl.ch/~odersky/" year: "2013" month: "January" abstract: "High level data structures are a cornerstone of modern programming and at the same time stand in the way of compiler optimizations. In order to reason about user or library-defined data structures, compilers need to be extensible. Common mechanisms to extend compilers fall into two categories. Frontend macros, staging or partial evaluation systems can be used to programmatically remove abstraction and specialize programs before they enter the compiler. Alternatively, some compilers allow extending the internal workings by adding new transformation passes at different points in the compile chain or adding new intermediate representation (IR) types. None of these mechanisms alone is sufficient to handle the challenges posed by high level data structures. This paper shows a novel way to combine them to yield benefits that are greater than the sum of the parts. Instead of using staging merely as a front end, we implement internal compiler passes using staging as well. These internal passes delegate back to program execution to construct the transformed IR. Staging is known to simplify program generation, and in the same way it can simplify program transformation. Defining a transformation as a staged IR interpreter is simpler than implementing a low-level IR to IR transformer. With custom IR nodes, many optimizations that are expressed as rewritings from IR nodes to staged program fragments can be combined into a single pass, mitigating phase ordering problems. Speculative rewriting can preserve optimistic assumptions around loops. We demonstrate several powerful program optimizations using this architecture that are particularly geared towards data structures: a novel loop fusion and deforestation algorithm, array of struct to struct of array conversion, object flattening and code generation for heterogeneous parallel devices. We validate our approach using several non trivial case studies that exhibit order of magnitude speedups in experiments." tags: - "data validation" - "optimization" - "object-oriented programming" - "intermediate representation" - "case study" - "graph transformation" - "interpreter" - "parallel programming" - "type system" - "macros" - "data-flow programming" - "graph-rewriting" - "code generation" - "transformation system" - "compiler" - "partial evaluation" - "subject-oriented programming" - "abstraction" - "program optimization" - "higher-order transformations" - "rewriting" - "systematic-approach" - "feature-oriented programming" - "transformation" - "program transformation" researchr: "https://researchr.org/publication/Rompf2013" cites: 0 citedby: 0 booktitle: "POPL 2013" kind: "inproceedings" key: "Rompf2013"