GitHub

Nexus is a language built on one bet: LLMs are good at code you can read on the page, and bad at code that depends on what's off the page. GC, implicit casts, ambient I/O, hidden control flow — these are the spots where LLM-written code goes wrong, and where humans miss it on review. Nexus swaps each one for a form you can see in the source.

Capabilities – Hello world

Each function says what caps it needs. You inject the caps with handlers at the call site.

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

Use each resource once, then it’s gone. No GC. The compiler tracks every cell.

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 and Parallel

A thunk waits to run. When two thunks don’t depend on each other, the runtime fires them in parallel. Linear types keep each one to a single shot.

let @a = compute_a()

let @b = compute_b()

// evaluate parallely

let result = @{ a, b }

Quick Start

nexus                   # REPL
nexus run example.nx    # interpret
nexus build example.nx  # compile to main.wasm
nexus check example.nx  # typecheck only

Design

Language Specification

Environment