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>
17 lines
359 B
Plaintext
17 lines
359 B
Plaintext
// 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
|
|
}
|