In this course, we explore a very powerful technique. We will develop our own interpreters and compilers for small domains.
Video Courses
Screencasts, Whiteboards, and Slides produced to help you learn
Video Lessons
Parts of courses on specific topics
Adding static scope information
We modify the compiler to add static scope information. Even though we don’t know the value of variables until runtime, we do know the names of the variables at compile time. We can use that to make missing variables a compiler error.
Crisp compiler
We take our trusty Crisp evaluator (interpreter) and step-by-step convert it into a compiler using a common and simple compiler technique.
From interpreter to compiler
We begin converting our Hiccup interpreter to a Hiccup compiler. That allows us to do compile-time optimizations.
Function calls in Crisp interpreter
Central to Lisp is the ability to call functions. We are building a language hosted on Clojure, so we will want to call Clojure functions to be able to borrow what’s already there. What’s more, we will want to define our own functions in Crisp, so we develop a way to do that. All with TDD!
Hiccup Interpreter
We build a Hiccup interpreter.
Introduction to DSLs
We define the terms Interpreter and Compiler, and build a model of how they work.