Lumina
TypeScript ergonomics, Rust-grade correctness, native performance.
Lumina is a statically typed, compiled language. It reads like TypeScript, but its compiler works more like Rust's: it checks exhaustiveness, mutability, error handling and side effects. It compiles through LLVM to native code, either JIT-executed (lumina run) or ahead-of-time built into a binary (lumina build).
These pages describe where Lumina is going. A small badge such as mostly done, in progress or designed marks what is nearly done, still partial or only designed (see the status legend), and Status & Roadmap says exactly where each point stands.
function main(console: Console): Integer {
name = "Lumina"
console.println(`Hello, {name}!`)
return 0
}
$ lumina run hello.lumina
Hello, Lumina!
Why Lumina?
If you write TypeScript, Go, Python or Rust, you have probably wished for some feature from one of the others. Lumina combines them on purpose:
- Familiar syntax, no ceremony. You write
function,:for types,=>for lambdas and backtick string interpolation. Types are inferred, there are no semicolons, and you never write lifetimes. See Syntax. - Immutable by default. A plain
x = 1is a constant, and you opt into change withmut. When you pass amutparameter, the caller can see it in the signature. See Mutability. - Errors are values, and they live in the type.
T?is an optional value andT!Eis a result.?propagates an error,??supplies a default, andmatchmust cover every case. There is nonulland there are no exceptions. See Errors & Types. - Generics and interfaces without the gymnastics. Bounded generics, generic structs, operator overloading and interfaces implemented after the fact. See Generics & Interfaces.
- Effects as parameters. I/O is a capability you pass in, such as
Console,FileSystemor aClockyou define. A function that takes none cannot do I/O, so you test it with a plain fake instead of a mocking framework. See Capabilities. - Async without the boilerplate. Lightweight stackful tasks spread across cores in progress,
spawn, channels, cancellation and async streams. See Async. - Memory without a borrow checker. Escape analysis puts what it can on the stack, and a GC covers the rest. The compiler tells you when something falls back to the GC heap. Annotations such as
@Memory.noAllocgive you checked allocation-free code. See Memory. - Built for servers. TCP, HTTP and kernel-level zero-copy primitives such as
spliceandMSG_PEEK, all from the standard library. See Zero-Copy & Servers. - Talks to C, ships a real stdlib.
@ExternCcalls into C. The stdlib covers JSON, crypto, regex, reflection and an LLM effect. See Interop & Stdlib. - One tool. A single
luminabinary runs, builds, tests, lints, auto-fixes, formats, explains errors, manages packages and serves an LSP. See Tooling.
A taste
function parseAge(text: String): Integer!ParseError {
if text.length() == 0 {
return Err(ParseError.Empty)
}
return match text.toInteger() {
Some(n) => Ok(n),
None => Err(ParseError.NotANumber { text: text })
}
}
function doubledAge(text: String): Integer!ParseError {
age = parseAge(text)? // early-return on error
return Ok(age * 2)
}
The error type is part of the signature, ? keeps the happy path flat, and if you forget to handle a ParseError variant in a match, compilation fails.
Honest status
The core pipeline works end to end (source, AST, HIR, MIR, LLVM IR, then JIT or AOT), and every code sample in these pages was run with the current compiler. Each badge links to its entry in Status & Roadmap. For live numbers, run cargo run --bin lumina_analyze in the repository, or read FEATURE_STATUS.md and ROADMAP.md.
Pages
- Syntax: variables, functions, structs, lambdas, loops
- Mutability: const by default,
mut, explicit copies - Errors & Types:
T?,T!E,?,??, enums,match, narrowing - Generics & Interfaces: bounds, generic structs, operators
- Capabilities: pure by default, effects as parameters, testing with fakes
- Async:
async/await,spawn, channels, cancellation, streams - Memory: escape analysis, GC fallback,
@Memoryannotations - Zero-Copy & Servers: TCP/HTTP,
splice,peek, io_uring - Interop & Stdlib:
@ExternC, JSON, crypto, regex, reflection, LLM effect - Tooling: run, build, test, lint, fix, explain, LSP, packages
- Built for Agents: fast, quiet compiler feedback for coding agents, and agents hosted inside Lumina programs
- Comparison: what Lumina takes from TypeScript, Go, Python and Rust
- Status & Roadmap: exactly what works today and what is planned
The full language reference is Language.md in the repository root.
Next: Syntax