Nexus is a programming language built on one premise: LLMs are strong at literal program constructs but weak at contextual ones. Garbage collection, implicit conversions, ambient I/O, continuation-based control flow — these contextual mechanisms are where LLM-generated code breaks and where human review fails. Nexus replaces them with syntactically explicit alternatives.
Capabilities – Hello world
Capability requirements declared in function signatures. Dependency injection via ports and handlers.
import { Console }, * as stdio from "std:stdio"
let main = fn () -> unit require { PermConsole } do
inject stdio.system_handler do
Console.println(val: "Hello, Nexus!")
end
end
Linear Types
Resources consumed exactly once. No GC — the compiler tracks every allocation.
let %h = Fs.open_read(path: "data.txt")
let %r = Fs.read(handle: %h)
match %r do
| { content: text, handle: %h2 } ->
Fs.close(handle: %h2)
end
Lazy Parallelism (@)
Lazy thunks with automatic DAG-parallel evaluation. Linear types guarantee one-shot semantics.
let @a = compute_a() // suspended — not evaluated
let @b = compute_b() // suspended — not evaluated
let result_a = @a // force both in parallel
let result_b = @b // (compiler detects independence)
Quick Start
nexus # REPL
nexus run example.nx # interpret
nexus build example.nx # compile to main.wasm
nexus check example.nx # typecheck only
Design
- Design Thesis — Why every construct is literal
Language Specification
- Syntax — Grammar and EBNF
- Types — Type system, linear types, borrowing
- Effects and Capabilities — Ports, handlers, inject
- Exception Groups — Structured exceptions, multi-arm catch
- Lazy, Concurrency, Parallelism —
@sigil, DAG parallel evaluation, linearity - Semantics — Evaluation model
Environment
- CLI — Command-line interface
- WASM and WASI — Capability mapping and ABI
- FFI — Wasm interop
- Standard Library — Builtin modules
- Tools — AI coding agent skill