Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Examples Index

This index maps tutorial chapters to runnable examples.

Chapter mapping

ChapterFocusTests
Chapter 1Parserast::tests::test_ast_fibonacci
ast::tests::test_ast_factorial
Chapter 2Dialect definitions and manual IR constructiondialect::tests::build_fib_example
Chapter 3AST to Kaleidoscope dialect loweringfrom_ast::tests::fibonacci_from_ast
from_ast::tests::factorial_from_ast
from_ast::tests::inline_fibonacci_from_ast
Chapter 4Kaleidoscope dialect to LLVM dialect loweringto_llvm::tests::fibonacci_to_llvm
to_llvm::tests::factorial_to_llvm
to_llvm::tests::if_else_to_llvm
Chapter 5JIT executionjit::tests::fibonacci_jit
jit::tests::factorial_jit
jit::tests::if_else_jit

Running chapter tests

cargo test --example kaleidoscope -- --list
cargo test --example kaleidoscope -- --show-output

Run a single test by name:

cargo test --example kaleidoscope -- fibonacci_to_llvm --show-output

Run the end-to-end CLI example:

cargo run --example kaleidoscope -- --input examples/kaleidoscope/fibonacci.kal --fn main --arg 5

Testing strategy

As examples become implementation-heavy, mirror key behaviors in integration tests under tests/ so chapter claims remain verifiable in CI.

Suggested learning paths

  • Parser-focused: Start at Chapter 1.
  • IR design-focused: Start at Chapter 2, then Chapter 3 and Chapter 4.
  • End-to-end pipeline: All chapters, in order.