feat: expose JIT compiler via CLI command
Add `lux compile <file>` command that compiles and runs Lux code using the Cranelift JIT compiler. Includes --benchmark flag for timing. - Add compile_file() function in main.rs - Add jit_test.lux example with fib(30) + factorial(10) - Update VISION.md status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
16
examples/jit_test.lux
Normal file
16
examples/jit_test.lux
Normal file
@@ -0,0 +1,16 @@
|
||||
// Test file for JIT compilation
|
||||
// This uses only features the JIT supports: integers, arithmetic, conditionals, functions
|
||||
|
||||
fn fib(n: Int): Int =
|
||||
if n <= 1 then n
|
||||
else fib(n - 1) + fib(n - 2)
|
||||
|
||||
fn factorial(n: Int): Int =
|
||||
if n <= 1 then 1
|
||||
else n * factorial(n - 1)
|
||||
|
||||
fn main(): Int = {
|
||||
let a = fib(30)
|
||||
let b = factorial(10)
|
||||
a + b
|
||||
}
|
||||
Reference in New Issue
Block a user