Chapter 2: Introduction to compilers

Bootstrapping

. Compiler is a complex program and should not be written in assembly language

. How to write compiler for a language in the same language (first time!)?

. First time this experiment was done for Lisp

. Initially, Lisp was used as a notation for writing functions.

. Functions were then hand translated into assembly language and executed

. McCarthy wrote a function eval[e,a] in Lisp that took a Lisp expression e as an argument

. The function was later hand translated and it became an interpreter for Lisp

Writing a compiler in assembly language directly can be a very tedious task. It is generally written in some high level language. What if the compiler is written in its intended source language itself ? This was done for the first time for Lisp. Initially, Lisp was used as a notation for writing functions. Functions were then hand translated into assembly language and executed. McCarthy wrote a function eval [ e , a ] in Lisp that took a Lisp expression e as an argument. Then it analyzed the expression and translated it into the assembly code. The function was later hand translated and it became an interpreter for Lisp.