Files
lux/examples/jit_test.lux
Brandon Lucas 554a1e7c3e 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>
2026-02-13 21:16:39 -05:00

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
}