Intern Track Roadmap

Compilers & interpreters

This course follows source code from text to execution. It explains what compilers and interpreters do, the spectrum between them, and the difference between AOT and JIT compilation. You build a small lexer and a recursive descent parser in Ruby, then inspect tokens, ASTs and YARV bytecode with Ripper, Prism and RubyVM tools. Later lessons cover stack-based virtual machines, the JVM, WebAssembly and ruby.wasm, bootsnap caching, and the JIT compilers in CRuby: MJIT, YJIT with basic block versioning, and the experimental ZJIT.

What you'll learn

  • ✓The phases of a compilation pipeline, from lexing to code generation
  • ✓How to write a simple lexer and a recursive descent parser in Ruby
  • ✓How CRuby turns Ruby source into YARV bytecode and runs it
  • ✓How to inspect tokens, ASTs and bytecode with Ripper, Prism and RubyVM
  • ✓How stack-based virtual machines, the JVM and WebAssembly execute bytecode
  • ✓How JIT compilation works in MJIT, YJIT and ZJIT
Free preview · Lesson 1 5 min read

What is a compiler?

Computers only understand machine code: raw binary instructions specific to a CPU architecture (x86, ARM, etc.). But humans write code in high-level languages like Ruby, C, or Go. Something must bridge this gap.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...