Get started

Install, write ten lines of NL, run them. The toolchain is two binaries: nlc the compiler and nlvm the virtual machine.

1. Install

$ curl -fsSL https://nlvm.dev/install.sh | bash

Installs prebuilt nlc and nlvm binaries into ~/.local/bin — no Rust toolchain required. Published for Linux (x86_64) and macOS (Apple Silicon); building from source works everywhere else, see below.

2. Write a program

Create Main.nl:

namespace hello;

class Main {
    public static int main(string[] args) {
        system.Out.println("Hello, world!");
        return 0;
    }
}

3. Compile and run

$ nlc Main.nl -o Main.nlp
$ nlvm Main.nlp
Hello, world!

That's it — Main.nlp bundles the whole program into one file, the only artifact you ship.

Where to go next

Advanced

Building from source

Need a platform we don't publish binaries for, or want to build it yourself? You need a Rust toolchain. Then, from a clone of the repo:

$ git clone https://github.com/nlvm-lang/nlvm.git
$ cd nlvm
$ cargo build -r
$ ./install.sh

Run from inside the cloned repo, install.sh detects the source checkout and symlinks the binaries it just built into ~/.local/bin instead of downloading one.

Multi-module output

Point -o at a directory instead of a file and the output is named after the class that defines main:

$ nlc Main.nl -o out/
$ nlvm out/hello.Main.nlp
Hello, world!
Prefer one .nlm module per class instead of a single bundled .nlp? nlc --emit-modules Main.nl -o out/ gives you the exploded layout, and nlvm out/ loads a whole directory.

Check your setup

$ nlc --version
nlc 0.23.0 (nlvm-specs 0.8.48)
$ nlvm --version
nlvm 0.23.0 (nlvm-specs 0.8.48)

Both report the crate version and the release of the language specification this build implements.

Run the test suite

The repository ships a YAML conformance suite — one file per language feature — which is what CI runs:

$ cargo test --workspace
$ cargo run -p nl-test-runner -- tests
232 passed, 0 failed, 232 total

Each test is a plain YAML file: NL source files, expected stdout, expected exit code. They double as executable documentation — browse them to see every feature in action.