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.
翻译:我们根据从头开始为小型示范语言实施一个小型自成一体的自成一体的编译员的想法,而不是使用其他编译员的构建框架,报告一个一年级的编译员建设课程,该课程围绕一个不断演变的、表达性和复杂性日益增强的语言体系,最终以一流语言、表达、模式匹配和垃圾收集为顶峰,代码生成技术基于象征性翻译的理念,它使得能够实施一个强大但并非非常有效的本地代码生成器。我们给课程提供动力,描述课程结构,并报告根据学生课程后调查得出的教学结果。