Building a Virtual Machine for Programming Language

Building a Virtual Machine for Programming Language

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 29 lectures (4h 26m) | 1.70 GB

Essentials of Low-level Interpretation

How programming languages work under the hood? What’s the difference between compiler and interpreter? What is a virtual machine, and JIT-compiler? And what about the difference between functional and imperative programming?

There are so many questions when it comes to implementing a programming language!

The problem with “compiler classes” in school is such classes are usually presented as some “hardcore rocket science” which is only for advanced engineers.

Moreover, classic compiler books start from the least significant topic, such as Lexical analysis, going straight down to the theoretical aspects of formal grammars. And by the time of implementing the first Tokenizer module, students simply lose an interest to the topic, not having a chance to actually start implementing a programing language itself. And all this is spread to a whole semester of messing with tokenizers and BNF grammars, without understanding an actual semantics of programming languages.

I believe we should be able to build and understand a full programming language semantics, end-to-end, in 4-6 hours — with a content going straight to the point, showed in live coding sessions as pair-programming and described in a comprehensible way.

In the Building a Virtual Machine class we focus specifically on runtime semantics, and build a stack-based VM for a programming language very similar to JavaScript or Python. Working closely with the bytecode level you will understand how lower-level interpretation works in production VMs today.

Implementing a programing language would also make your practical level in other programming languages more professional.

What you’ll learn

  • Virtual Machines implementations
  • Stack-based vs. Register-based VMs
  • Bytecode interpreter
  • Compiler construction
  • Call stack and Stack frames
  • Low-level interpretation
  • Object-oriented programming
  • Functional programming
  • Closures implementation
  • Garbage Collection
  • Mark-Sweep GC
  • Understand how programming languages work under the hood
  • Bytecode optimization
Table of Contents

VM basic operations
1 Introduction to Virtual Machines
2 Stack-based vs. Register-based VMs
3 Logger implementation
4 Numbers Introduction to Stack
5 Math binary operations
6 Strings Introduction to Heap and Objects
7 Syntax Parser implementation
8 Compiler Bytecode
9 Complex expressions

Control flow and variables
10 Comparison Booleans
11 Control flow Branch instruction
12 Disassembler
13 Global variables
14 Blocks Local variables
15 Control flow While-loops

Functions and Call stack
16 Native functions
17 User-defined functions
18 Call stack Return address
19 Lambda functions
20 Bytecode optimizations

Closures implementation
21 Closures Scope analysis
22 Closures Compilation
23 Closures Runtime

Garbage Collection
24 Tracing heap Object header
25 Mark-Sweep GC

Object-oriented programming
26 Class objects Methods storage
27 Instance objects Property access
28 Super classes Inheritance
29 Final VM executable Final VM executable

Homepage