Files
lux/examples/jit_test.lux
Brandon Lucas f5fe7d5335 fix: fix examples to use working patterns
- behavioral.lux: use verifiable behavioral patterns (abs for idempotent)
- behavioral_types.lux: use simpler verified patterns, proper main invocation
- schema_evolution.lux: simplify to runtime schema ops, fix record access
- jit_test.lux: add proper main function with console output

All examples now parse and run correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 23:31:21 -05:00

21 lines
595 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(): Unit with {Console} = {
let fibResult = fib(30)
let factResult = factorial(10)
Console.print("fib(30) = " + toString(fibResult))
Console.print("factorial(10) = " + toString(factResult))
Console.print("Total = " + toString(fibResult + factResult))
}
let output = run main() with {}