feat: implement Cranelift JIT compiler for native code execution

Add a JIT compiler using Cranelift that compiles Lux functions to native
machine code. Achieves ~160x speedup over the tree-walking interpreter
(fib(30): 11.59ms JIT vs 1.87s interpreter).

Supports: arithmetic, comparisons, conditionals, let bindings, function
calls, and recursion. Compile time overhead is minimal (~500µs).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 17:11:19 -05:00
parent 296686de17
commit d8e01fd174
5 changed files with 890 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
//! Lux - A functional programming language with first-class effects
mod ast;
mod compiler;
mod debugger;
mod diagnostics;
mod exhaustiveness;