filmov
tv
Writing a compiler. Bytecode finale
![preview_player](https://i.ytimg.com/vi/5mvQOScXDl0/maxresdefault.jpg)
Показать описание
In this video we complete the bytecode compiler for Fang by adding support for lambdas, closures, function application, and conditionals. This is the most interesting and the most complicated part of the bytecode compiler.
Check-out Marksman (LSP server for Markdown written in F#):
Source-code for Fang compiler is available at:
Timecodes:
00:00 Intro
02:36 Recap
03:21 High-level idea
10:24 Chunked instruction tape
12:08 Codegen: lambda abstraction
15:05 Codegen: function application
17:50 Chunks and labels
18:33 Label Manager
19:26 Stitching bytecode chunks
23:13 Assignment fiasco
23:48 Finishing bytecode stitching
24:06 Teaching the VM to work with closures
24:40 Implementing the instructions in the VM
29:09 Running on test examples
30:12 Debug 1: assignment fiasco
30:49 Still don't see the issue
31:12 Debug 1 complete
31:44 Debug 2: know thy halt
35:07 Debug 2: complete
37:01 Debug 3: closures and environments
39:52 Debug 3: completed
40:33 Closures completed. What's next
40:50 EnvUpdate for recursive bindings
42:04 Codegen: conditionals
50:44 Jumps in the VM
52:43 Testing conditionals
53:16 Debug 4: JUMP JUMP JUMP
56:28 Debug 4 complete
56:41 All bugs are squashed
57:39 Conclusion
Check-out Marksman (LSP server for Markdown written in F#):
Source-code for Fang compiler is available at:
Timecodes:
00:00 Intro
02:36 Recap
03:21 High-level idea
10:24 Chunked instruction tape
12:08 Codegen: lambda abstraction
15:05 Codegen: function application
17:50 Chunks and labels
18:33 Label Manager
19:26 Stitching bytecode chunks
23:13 Assignment fiasco
23:48 Finishing bytecode stitching
24:06 Teaching the VM to work with closures
24:40 Implementing the instructions in the VM
29:09 Running on test examples
30:12 Debug 1: assignment fiasco
30:49 Still don't see the issue
31:12 Debug 1 complete
31:44 Debug 2: know thy halt
35:07 Debug 2: complete
37:01 Debug 3: closures and environments
39:52 Debug 3: completed
40:33 Closures completed. What's next
40:50 EnvUpdate for recursive bindings
42:04 Codegen: conditionals
50:44 Jumps in the VM
52:43 Testing conditionals
53:16 Debug 4: JUMP JUMP JUMP
56:28 Debug 4 complete
56:41 All bugs are squashed
57:39 Conclusion
Комментарии