Lecture 1: What is a Compiler?

Eelco Visser
Lecture | PDF
September 02, 2021

In the opening lecture we look at what compilers are, why you would want to study them, and how the course is organized.

Slides

Reading Material

The lecture discusses the traditional compiler pipeline. In the course we will be using the Spoofax language workbench to define and implement languages. The [OOPSLA 2010] paper describes the design of Spoofax. The [SEFM 2020] paper gives an overview of SDF3, the language we will for syntax definition.

Tutorial

Introduction to a tutorial on Spoofax at the PLDI 2020 conference in June 2020.

References

  • SEFM 2020 [doi, bib, researchr, ]
    SDF3 is a syntax definition formalism that extends plain context-free grammars with features such as constructor declarations, declarative disambiguation rules, character-level grammars, permissive syntax, layout constraints, formatting templates, placeholder syntax, and modular composition. These features support the multi-purpose interpretation of syntax definitions, including derivation of type schemas for abstract syntax tree representations, scannerless generalized parsing of the full class of context-free grammars, error recovery, layout-sensitive parsing, parenthesization and formatting, and syntactic completion. This paper gives a high level overview of SDF3 by means of examples and provides a guide to the literature for further details.
  • OOPSLA 2010 [pdf, doi, bib, researchr, ]
    Spoofax is a language workbench for efficient, agile development of textual domain-specific languages with state-of-the-art IDE support. Spoofax integrates language processing techniques for parser generation, meta-programming, and IDE development into a single environment. It uses concise, declarative specifications for languages and IDE services. In this paper we describe the architecture of Spoofax and introduce idioms for high-level specifications of language semantics using rewrite rules, showing how analyses can be reused for transformations, code generation, and editor services such as error marking, reference resolving, and content completion. The implementation of these services is supported by language-parametric editor service classes that can be dynamically loaded by the Eclipse IDE, allowing new languages to be developed and used side-by-side in the same Eclipse environment.