Goal

To understand how a super simple compiler works by going through the code in the repo below, and transforming it to TypeScript.

Creating an extensive type system for the stages of the compiler will help me understand what actually happens in each stage.

Hopefully, creating a type system for the compiler will allow me to visualize everything better and maybe teach it as well.


What is it?

A really small compiler that turns Lisp-like code (add 1 2) into C-like code add(1, 2).

Stages of the compiler

Tokenizer

Parser

Transformer

Code Generator


Important Links

URL: https://the-super-tiny-compiler.glitch.me/

Original GitHub Repo:

jamiebuilds/the-super-tiny-compiler

My fork:

SammyIsra/the-super-tiny-compiler