~/talk

Demystifying LLVM: Writing Your First Compiler - The Good, The Bad, The Ugly

Talkat Rust Nation UK 2026 · on Thursday, 2026-02-19· [rust]
name:Lyle Dean
github:lyledean1
slides:none on file

Built a toy compiler called Cyclang in Rust and targets LLVM via the low‑level C bindings so the code generator emits LLVM IR and uses the JIT or can produce a binary. Parser uses pest and the AST performs desugaring (for → while) and loop‑depth checks to implement break as a small IR branch change. Strings end up implemented in C, constant folding and dead‑code elimination come from LLVM optimizations.

AI-written summary · about

  1. 0:00Building a toy compiler with LLVM
  2. 1:12What is LLVM and why it matters
  3. 3:45Compiler workflow overview
  4. 8:46For loop in Cyclang and AST conversion
  5. 11:15LLVM IR of a for loop
  6. 15:15Adding break to the language
  7. 19:14Live demo of Cyclang compiler
  8. 23:43Challenges with strings in LLVM
  9. 26:09Learning LLVM three years ago versus today with AI
  10. 27:57Summary
  11. 28:17Q&A: Whitespace in PEG parsers
  12. 30:04Q&A: LLVM bindings vs higher-level libraries
  13. 32:10Q&A: Interpreted vs pre-compiled with LLVM
  14. 33:58Q&A: Optimization levels in REPL
  15. 34:41Q&A: Custom compiler backend plans
  16. 35:45Q&A: Syntax highlighting with Cyclang
  17. 37:53Q&A: Memory allocation and GC
~/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.