Design a simple dynamically-typed scripting language and build a just-in-time compiler for it. You will implement a recursive-descent parser, an AST-based bytecode compiler, and a JIT backend using LLVM that generates machine code at runtime with type specialization and inline caching.
Define the language grammar. Build parser and produce AST. Compile AST to a stack-based bytecode with type tags for each value.
Set up LLVM JIT compiler. Translate bytecode to LLVM IR. Implement basic operations: arithmetic, branching, function calls. Link against stdlib.
Implement lazy JIT compilation. Functions are compiled on first call. Cache compiled code. Add inline caching for property access and method dispatch.
Profile value types at runtime. Generate type-specialized versions of hot functions (monomorphic/polymorphic dispatch). Deoptimize on type mismatch with on-stack replacement.
Implement a simple mark-and-sweep garbage collector. Integrate with JIT-generated code via write barriers and stack map metadata. Add generational collection for short-lived objects.
Complete all prerequisite tracks to unlock this capstone. Once submitted, your project will be peer-reviewed by 3 fellow completers.
Start Prerequisites