Back to Browse

Writing a compiler. Bytecode basics

4.2K views
May 9, 2022
35:41

Continuing the implementation of a compiler for a functional language in F#. Now the time has come to work on the bytecode. Compared to a tree-walking interpreter, the setup for bytecode compilation is more involved, so the actual implementation is split into several videos. In this video we'll lay the groundwork: define types and basic components required to generate and execute Fang bytecode. 00:00 - Intro 02:03 - Compilation: native and bytecode 04:03 - Stack VM 06:55 - Module scaffolding 10:57 - BytecodeBuilder scaffolding 13:19 - Start working on the bytecode gen 16:53 - Bytecode for arithmetic 22:27 - More BytecodeBuilder infrastructure 23:10 - Fleshing out the VM 29:31 - Final touches 31:42 - Running the bytecode 32:35 - Bytecode in the debugger 34:54 - Outro

Download

1 formats

Video Formats

360pmp458.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Writing a compiler. Bytecode basics | NatokHD