Mini JIT Compiler | TempleOS Terry Davis Archive (2014)
Channel: Terry Davis Technical Videos
Date: 2020-10-27

Terry Davis talks about TempleOS' mini demonstration compiler. He covers the basics of lexing (aka tokenization), left-recursive parsing, and just-in-time compilation.

Note: This version of TempleOS differs in some ways to the final version. Also, watching at a higher speed is recommended.

00:00 Intro
00:40 Lexer overview
01:55 Demonstration / machine code
04:00 The stack during execution
05:30 Lexer walk-through
07:18 Parsing
09:00 Theory behind parsing
13:30 Symbol table
15:35 "JIT is easier than AOT"
16:15 Address map

If these terms are new to you, it may be hard to follow along, but it;s a great resource. I suggest Destroy All Software's "A Compiler from Scratch" video for a practical intro to lexing and recursive parsing (linked below).

If you're working in TempleOS, check out the "Hash" section of the f1 help menu, as well as the "Who" command, which dumps the table. Explaining the symbol table is difficult, but once you see it, it becomes obvious.

- https://www.destroyallsoftware.com/screencasts/catalog/a-compiler-from-scratch