Numerical semantics
Floating-point operations may be reassociated. Approximate equality is a language operator.
lulang compiles numerical functions to native code. Programs use value semantics, and floating-point expressions may be reassociated. Compiled functions can be called from C or Python.
export fn saxpy(a: f64, x: [f64], inout y: [f64], n: i64) {
for i in 0..n {
y[i] = a * x[i] + y[i]
}
}lulang is intended for small numerical kernels. Its semantics make common numerical optimizations legal without unsafe compiler flags.
Floating-point operations may be reassociated. Approximate equality is a language operator.
Arrays and records are values. A function cannot retain an alias to its caller's data.
lu build --lib creates a library, a C header, and a machine-readable manifest.
A lulang library can be added to an existing C or Python program. The application and its data structures do not need to be rewritten.
lu build --lib --shared file.lu creates the native library and interface files.pylulang.Edit the example and press Run. The interpreter runs locally in this page.
Ready. Choose an example or write a kernel.