~/talk

Writing a compiler with LLVM

Talkat NDC Oslo 2022 · 2022-09-26..09-30· [rust]
links:none on file
slides:none on file

A worked example builds MethodScript into native executables using LLVM 12 and the toolchain llc/opt/llvm-link, emitting human-readable LLVM IR then object files and a final exe. The compiler emits stack alloc/store/load for locals but mem2reg removes them, turning locals into SSA registers; loop-unroll plus instcombine collapses repeated adds into a single add. Demonstrations include a Minecraft SMS demo that runs, and a platform detail: Windows rand() is 16‑bit so two calls are combined into a wider value.

AI-written summary · about

  1. 0:00Introduction to MethodScript
  2. 1:43Compiler architecture basics
  3. 7:28Understanding the LLVM model
  4. 11:20Parsing and building the AST
  5. 14:40Generating and linking IR
  6. 21:40Compiler optimizations
  7. 37:25Resources and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.