Reimplementing the Wheel: Teaching Compilers with a Small Self-Contained One

Daniil Berezun
Dmitry Boulytchev

We report on a one-semester compiler construction course based on the idea of implementing a small self-contained compiler for a small model language from scratch, not using other compiler construction frameworks. The course is built around an evolving family of languages with increasing expressiveness and complexity, which finally is crowned by a language with first-class functions, S-expressions, pattern matching, and garbage collection. The code generation technique is based on the idea of symbolic interpreters, which allows to implement a robust albeit not a very efficient native code generator. We give the motivation for the course, describe its structure, and report some results of teaching based on students' post-course surveys.

In Peter Achten and Elena Machkasova: Proceedings Tenth and Eleventh International Workshop on Trends in Functional Programming In Education (TFPIE 2021/22), Kraków, Poland (online), 16th February 2021/16th March 2022, Electronic Proceedings in Theoretical Computer Science 363, pp. 22–43.
Published: 26th July 2022.

ArXived at: bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to:
For website issues: