LULANG PROGRAMMING LANGUAGE

lulang

A small language for numerical computing.

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.

Interpreter
reference implementation
JIT + LLVM
native code generation
C · Python
generated interfaces
kernel_saxpy.luBOUNDARY ABI
export fn saxpy(a: f64, x: [f64], y: [f64], n: i64): f64 {
  var total = 0.0
  for i in 0..n {
    y[i] = a * x[i] + y[i]
    total = total + y[i]
  }
  return total
}
libkernel_saxpy.a · .dylib/.so · .h · .json
01 / OVERVIEW

Main properties

lulang is intended for small numerical kernels. Its semantics make common numerical optimizations legal without unsafe compiler flags.

01

Numerical semantics

Floating-point operations may be reassociated. Approximate equality is a language operator.

02

Value semantics

Arrays and records are values. A function cannot retain an alias to its caller's data.

03

C interface

lu build --lib creates a library, a C header, and a machine-readable manifest.

02 / USE FROM AN EXISTING PROGRAM

Compile one function.

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.

  1. 01
    Write a functionUse scalar, array, and record types to express the calculation.
  2. 02
    Compile a librarylu build --lib --shared file.lu creates the native library and interface files.
  3. 03
    Call the functionInclude the generated C header, or load the manifest with pylulang.
03 / ONLINE INTERPRETER

Try lulang

Edit the example and press Run. The interpreter runs locally in this page.

EXAMPLESCore subset interpreter
Runs on this device
main.lu
OUTPUTIDLE
Ready. Choose an example or write a kernel.
04 / BENCHMARK OBSERVATORY

The benchmark includes its source.

Results are whole-process medians. Each row names the machine, compiler, layout, floating-point assumptions, and source used in every language. A missing runtime is left blank.

Open the observatory
2026-07-23 · APPLE ARM64LOWER IS BETTER
dot 2M × 20lulang selfhost13.677 msC++ fast11.902 ms
slerp 2Mlulang selfhost12.096 msC++ fast12.669 ms
05 / IMPLEMENTATIONS
REFERENCECFG interpreter
DEVELOPCranelift JIT
SHIPLLVM AOT
ASCENDSelf-hosted compiler