Crafting interpreters
Chapter 1
You can implement a compiler in any language, including the same language it compiles, a process called āself-hostingā.
You canāt compile it using itself yet, but if you have another compiler for your language written in some other language, you use that one to compile your compiler once.
Now you can use the compiled version of your own compiler to compile future versions of itself and you can discard the original one compiled from the other compiler.
This is called ābootstrappingā from the image of pulling yourself up by your own bootstraps.

A parser takes the flat sequence of tokens and builds a tree structure that mirrors the nested nature of the grammar.
These trees have a couple of different namesāāāāparse treeā or āabstract syntax treeāāāādepending on how close to the bare syntactic structure of the source language they are.
In practice, language hackers usually call them āsyntax treesā, āASTsā, or often just ātreesā.
Last updated