Skip to content

Nulang

Build fault-tolerant distributed systems with the elegance of algebraic effects and row-polymorphic types.

Building reliable distributed systems today usually means stitching together actors, queues, databases, workflow engines, and observability tools. Nulang integrates those capabilities into the language itself so you can focus on your application logic instead of infrastructure plumbing.

Nulang’s actor model and supervision trees mean failures are isolated and restarted automatically. A bad message or a crashing service doesn’t take down the whole system.

SSupervisorA1Actor 1A2Actor 2A3Actor 3A4Actor 4

Actors communicate through location-transparent messages. Move a service from one node to many, and the code stays the same.

Node 1Node 2Node 3

Declare agents as language primitives with built-in LLM integrations, episodic/semantic/procedural memory, pipelines, debates, and supervisor teams.

InputLLMMemoryDebateOutputepisodicsemanticprocedural

Workflows checkpoint durable state and use saga compensation to roll back safely when a step fails.

Reference capabilities and per-actor garbage collection give you memory safety without global stop-the-world pauses, while the JIT and native AOT backends keep hot paths fast.

Actor 1Actor 2Actor 3Actor 4✓ No stop-the-world pauses

Nulang is open source and licensed under the Apache 2.0 license. The source code, issue tracker, and contribution workflow live on GitHub.

View Apache 2.0 License

Distributed Actors

Location-transparent actors with BEAM/OTP primitives — spawn, link, monitor, supervise. Automatic clustering with gossip membership and CRDT state replication.

Algebraic Effects

Koka-inspired row-polymorphic effects with compile-time checking. Handle, perform, resume — algebraic effect handlers compose freely without monad transformers.

Row-Polymorphic Types

Full Hindley-Milner type inference with row polymorphism for both records and effects. Pony-inspired reference capabilities (iso, trn, ref, val, box, tag) enforced at compile time.

BEAM/OTP Primitives

Supervision trees (one_for_one, one_for_all, rest_for_one, simple_one_for_one), process groups, named registration, and exit trapping — battle-tested fault tolerance patterns.

WASM Backend

Compile to WebAssembly with full MIR→WASM translation. Run in Wasmtime with 4GiB guard pages, SIMD support, and AOT compilation for near-native performance.

AI Runtime

Built-in LLM integration with provider-agnostic API (OpenAI, Ollama). Agent pipelines, debate teams, supervisor hierarchies, and episodic/semantic/procedural memory.

// A simple counter actor
actor Counter {
state count: Int = 0
behavior inc() {
self.count = self.count + 1
}
behavior get(sender: Actor) {
send sender reply(self.count)
}
}
// Spawn and use it
let counter = spawn Counter {} in {
send counter inc()
send counter inc()
// counter.count is now 2
counter
}
Terminal window
# Clone and build from source
git clone https://github.com/dporkka/nulang.git
cd nulang
cargo build --release
# Start the REPL
cargo run -- --repl

Nulang is open source under the Apache 2.0 license. If you find it valuable, consider supporting its development.