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:
@@ -15,6 +15,13 @@ serde_json = "1"
|
||||
rand = "0.8"
|
||||
reqwest = { version = "0.11", features = ["blocking", "json"] }
|
||||
|
||||
# Cranelift for native compilation
|
||||
cranelift-codegen = "0.95"
|
||||
cranelift-frontend = "0.95"
|
||||
cranelift-module = "0.95"
|
||||
cranelift-jit = "0.95"
|
||||
target-lexicon = "0.12"
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user