Skip to content
nulang-orgPublic

About

Nulang is a type-safe programming language and runtime designed for building fast, distributed, durable applications.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,952 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Nulang logo

Nulang

A typed language for concurrent, durable, and distributed software with algebraic effects, reference capabilities, actors, and durable execution.

Website • Playground • Nulang Cloud • GitHub

Rust 2021 License Apache 2.0 CI Coverage Docs Sync DeepWiki


New to Nulang? Try Core in the browser (no install) · Install a checksummed release · Run the quick start. Native actors, networking, and durable runtime features require a local binary.

What is Nulang?

Nulang is a programming language for concurrent, durable, and distributed software. Its semantic core combines a Hindley-Milner type system, reference capabilities (iso/trn/ref/val/box/tag/lineariso), and row-polymorphic algebraic effects. Erlang-style fault-tolerant actors are the first-class abstraction for independently addressable isolated state; ordinary local computation remains ordinary computation rather than being modeled as an actor. The compiler pipeline (AST → HIR → MIR) uses the register-based bytecode VM as the semantic reference implementation. Hot regions can tier into a Cranelift JIT; WASM is the canonical portable/cloud execution target; and native AOT remains a secondary backend until full semantic parity is demonstrated. An experimental WasmFX backend explores stack-switching for suspending effects. The runtime supports sharded multi-threaded execution: each Runtime shard has one owning cooperative scheduler thread, and NULANG_SHARDS>1 runs shards in parallel with bounded cross-shard channels. The scheduler implementation retains Chase-Lev work-stealing APIs for multi-worker callers, but the live per-shard run_scheduler() path currently uses one worker slot. Supervision trees, ORCA garbage collection, durable persistence, and experimental location-transparent distribution are integrated into that model.


Installation

Pre-built binaries

Tagged releases publish checksummed archives from the release CI matrix:

  • Linux (x86_64): nulang-linux-x86_64.tar.gz
  • Linux (aarch64): nulang-linux-aarch64.tar.gz
  • macOS (Apple Silicon / aarch64): nulang-macos-aarch64.tar.gz
  • Windows (x86_64): nulang-windows-x86_64.tar.gz

Download the latest archive and its matching .sha256 file from GitHub Releases, verify the checksum, then put the extracted executable on your PATH.

Linux x86_64 example:

sha256sum -c nulang-linux-x86_64.tar.gz.sha256
tar xzf nulang-linux-x86_64.tar.gz
install -m 0755 nulang-linux-x86_64 ~/.local/bin/nulang

Windows x86_64 archives contain the release executable under its platform-qualified name; rename it to nulang.exe after extraction and place it in a directory on PATH.

From source

git clone https://github.com/nulang-org/nulang.git
cd nulang
cargo build --release

Source builds use Rust 1.95.0, pinned by rust-toolchain.toml. The tagged release matrix currently validates Linux x86_64/aarch64, macOS aarch64, and Windows x86_64; other platform/architecture combinations are not release-tested.

Quick Start

A pre-built release binary needs no Rust toolchain. To build from source, use Rust 1.95.0:

git clone https://github.com/nulang-org/nulang.git
cd nulang
cargo build --release
nulang hello.nula              # compile + run
nulang --check hello.nula      # type-check only
nulang --eval '40 + 2'         # evaluate inline code
nulang --repl                  # interactive REPL

A Nulang program:

perform IO.print("Hello, Nulang!")

let name = "World"
perform IO.print("Hello, " + name + "!")

Run nulang examples/01_hello.nula. See examples/ for 17 verified programs covering actors, effects, pattern matching, records, loops, arrays, HTTP, JSON, and more.

No install? Try the hosted browser playground. It runs the compiler frontend + CoreVM locally in WebAssembly. Actors, networking, FFI, and JIT execution still require the native runtime.


Feature Highlights

  • Algebraic effects — perform Effect.op(args) / handle body with { | Effect.op(x) => ... } with resume semantics. Effect dependencies are explicit in function signatures via ! rows.
  • Reference-capability types — iso, trn, ref, val, box, tag, and lineariso govern aliasing, mutation, ownership, and cross-actor sendability. They are distinct from external authority grants.
  • Hindley-Milner type inference — full Algorithm W with row-polymorphic records, variant types, and algebraic effect rows.
  • Actors — spawn, send/!, ask, selective receive with after timeout, links, monitors, supervision trees, process groups, and actor priority scheduling.
  • Typed actor protocols — structural ActorRef[P] contracts can restrict public actor APIs to required behaviors. Compiler-derived protocol fingerprints, a trusted schema registry, directional compatibility checks, and pre-mailbox admission are implemented as Experimental protocol hardening.
  • Entities & workflows — entity declarations are durable-first and event-sourced by default. The higher-level workflow declaration surface supports steps, timers, signals, and saga compensation on the reference bytecode runtime and remains Experimental. The canonical portable/cloud WASM backend currently rejects workflow declarations fail-closed until it can preserve those durable semantics end to end.
  • let and var — immutable and mutable bindings. Records with { field: value } syntax and { base .. field = new_val } update syntax. Pattern matching with guards, alias patterns, and recursive sub-patterns. ** exponentiation. Multi-line """...""" strings with \u{...} unicode escapes. Pipe operator |>.
  • Error handling — catch expr fallback (prefix or postfix), fail Error(...) for structured short-circuit return, T ! E return types, ? unwrap.
  • FS file I/O — perform FS.read(path), perform FS.write(path, content), perform FS.append(path, content), perform FS.exists(path).
  • Package manager — nula new/init/build/run/test/add/remove/list/clean/doc. See below.
  • Test runner — nula test discovers .nula files under tests/; uses the Test effect (perform Test.assert_eq(a, b), perform Test.assert(cond, msg), etc.).
  • LSP server — nulang --lsp with diagnostics, hover, goto-definition, references, rename, completion, inlay hints, formatting, signature help, and semantic tokens.
  • REPL — nulang --repl with :help <topic>, :type <expr>, :load <file>, tab completion, and automatic multi-line input.
  • AI runtime — agent declarations, LLM providers (OpenAI, Ollama), episodic/semantic/procedural memory, pipelines, debates, and supervisor teams. Gated behind the ai-runtime feature flag. Experimental.
  • Distribution — location-transparent send/ask over TCP (NUL0 wire protocol) and gossip membership. Experimental. The 8 CRDT types (GCounter, ORSet, …) are implemented and tested at the Rust embedder level only — .nula-level state crdt fields are not yet wired to them and behave as durable (see SPEC2 §9.10).
  • Fabric — an Experimental messaging/stream substrate layered on the actor transport, with topic routing, consumer groups, durable replicated streams, quorum commit, epoch fencing, bounded repair/retry, and confirmed-removal failover. See docs/FABRIC.md.
  • RESP-compatible cache kernel — an Experimental Redis-compatible cache path with packed shard-local storage, Redis Cluster slot routing/MOVED, ordered pipelining, and an optional dedicated Mio reactor via the cache-server feature. See docs/RESP_CACHE_ARCHITECTURE.md.
  • WASM backend — MIR→WASM compilation via --backend wasm|wasm-run|wasm-aot, with Wasmtime hosting and SIMD support. This is the canonical portable/cloud execution target, but the current plain-WASM profile still supports fewer language/runtime semantics than bytecode. The separate wasmfx-backend feature is an Experimental stack-switching path for suspending effects.
  • Secondary native AOT backend — --backend native compiles a restricted subset through Cranelift. It remains useful for differential testing and supported pure/native workloads, but it is not the semantic reference and must not be assumed to have full parity with bytecode. Experimental.

Documentation

Document Description
docs/GETTING_STARTED.md Installation, values, effects, actors, pattern matching — with runnable code snippets
docs/ADOPTION_PILOT.md Independent-developer pilot protocol and measurable adoption gate (#809)
docs/TUTORIAL.md Tutorial: Build a Weather CLI step by step — variables, functions, HTTP, JSON, pattern matching, records, file I/O
docs/PITFALLS.md Common mistakes: :: vs ., let vs var, perform keyword, catch/fail, record syntax, and more
examples/ + README 17 verified, self-contained example programs
SPEC2.md Language specification: syntax, semantics, type system, runtime, format stability contract
CHANGELOG.md Changelog organized by stability tier (Frozen / Stable / Experimental)
GOVERNANCE.md Stability tiers, RFC process, and language versioning
ARCHITECTURE.md Implementation architecture and module map
docs/IMPLEMENTATION_STATUS.md Concise current-main matrix: shipped backends, actor runtime, durability, distribution, and status boundaries
docs/SEMANTIC_STABILIZATION_CONTRACT.md Current semantic-source-of-truth, backend, durability, and production-validation contract
docs/FABRIC.md Experimental distributed messaging and durable stream substrate
docs/RESP_CACHE_ARCHITECTURE.md Experimental RESP-compatible cache architecture and cluster-routing invariants
editors/vscode/ VS Code extension (syntax highlighting, language essentials, snippets) — build a .vsix or install manually
RFC/0024-orthogonal-execution-model.md Orthogonal model for local computation, scoped tasks, actors, persistence, and identity
RFC/ RFC proposals (format stability, frozen core, deprecation cycles, roadmap)

Docs auto-sync and DeepWiki

Changes to src/**, examples/**, scripts/**, docs/**, or the .github/workflows/docs-sync.yml workflow trigger a docs regeneration run on every push to main. The workflow regenerates the standard-library/API references and browser-playground bundle, validates the Astro site, then opens or updates the protected-branch automation/docs-sync PR with those generated assets. Once that PR passes the required checks and is merged, Cloudflare Pages redeploys main. When the workflow uses the default GITHUB_TOKEN, GitHub requires a maintainer to approve the generated PR's workflow runs; an optional DOCS_SYNC_TOKEN PAT/App token removes that approval step.


Package Manager

Nulang ships with nula, a package manager invoked as nulang nula <subcommand>:

nulang nula new my-app       # scaffold a new package
nulang nula init             # initialize a package in the current directory
nulang nula build            # resolve dependencies + type-check
nulang nula run              # build and run the entry point
nulang nula test             # discover and run tests/ directory
nulang nula add <name>       # add a dependency (--path, --git, --version)
nulang nula publish          # publish the package to a registry
nulang registry serve        # run a local package registry server
nulang nula remove <name>    # remove a dependency
nulang nula list             # list locked dependencies
nulang nula clean            # remove build artifacts
nulang nula doc              # generate Markdown API docs

Project Status & Stability

Nulang is alpha software. Existing v1 artifacts still carry the historical 1.0.0-frozen language metadata, but accepted RFC 0021 no longer treats pre-adoption source semantics as permanently Frozen. Published formats remain archival compatibility obligations, while source semantics stay Stable until the external-adoption freeze gate is satisfied. See GOVERNANCE.md for the full definitions:

Tier Scope
Frozen Published v1 compatibility contracts: .nbc format v1, NUL0 v1, value layout v1, plus any explicitly Frozen effect contracts. Old versions are never silently reinterpreted; future versions may evolve behind explicit version boundaries.
Stable Nulang Core (pre-adoption), HM type system, effect rows, capability lattice, actor surface. Breaking changes require an RFC, an explicit version transition, diagnostics, and a migration path.
Experimental Everything else — including wasm-backend/wasmfx-backend, cache-server, the AI runtime, Fabric, typed actor-protocol hardening, multi-node distribution, CRDTs (Rust-level only so far), optional persistence backends, and other items marked Experimental in CHANGELOG.md.

Pre-1.0 disclaimer: Nulang does not have external users yet. The tier guarantees above are the maintainer's stated policy and intent, but expect breaking changes before v1.0 — any guarantee may be revised until the language sees real-world use.

The required GitHub Actions matrix is the release-readiness source of truth for build, test, lint, audit, documentation, formal-spec, minimal-feature, and WASM-backend validation. For local validation, run cargo test --locked; add --features wasm-backend for the WASM backend suite.


Nulang Cloud

Nulang Cloud is the optional managed platform for Nulang deployment, runtime, and platform tooling. It is under active development; check the Cloud site for the currently available surfaces rather than treating planned platform capabilities as production guarantees.

The language and runtime in this repository are Apache-2.0 and self-hostable.


Docker

A multi-stage Docker image is available. Build and run:

docker build -t nulang .
docker run --rm nulang --eval 'perform IO.print("Hello from Docker!")'

The image is ~50 MB and contains only the nulang binary and its runtime dependencies.

Community


Docs & Wiki

The nulang.org documentation site is regenerated automatically on every push to main via the Docs Sync workflow. When source files, examples, or docs content change, the workflow rebuilds generated docs and the browser playground, verifies the Astro site, and proposes the generated files through the automation/docs-sync pull request rather than pushing directly to protected main.


License

Nulang is licensed under the Apache License, Version 2.0.

Copyright 2026 © David Porkka

About

Nulang is a type-safe programming language and runtime designed for building fast, distributed, durable applications.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages