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.
Coeffects – Hello world
Capability requirements declared in function signatures. Dependency injection via ports and handlers.
import { Console }, * as stdio from "stdlib/stdio.nx"
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
case { content: text, handle: %h2 } ->
Fs.close(handle: %h2)
end
Conc Blocks
Parallel tasks with captured variables. Compiles to WASM with WASI capabilities.
let %arr = [| 0, 0 |]
conc do
task t1 do
let r = &%arr; r[0] <- compute_a()
end
task t2 do
let r = &%arr; r[1] <- compute_b()
end
end
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 Coeffects — Ports, handlers, inject
- Semantics — Evaluation model, concurrency
Environment
- CLI — Command-line interface
- WASM and WASI — Capability mapping and ABI
- FFI — Wasm interop
- Standard Library — Builtin modules
- Tools — AI coding agent skill