A lightweight, statically typed, compiled programming language.
Status: pre-alpha. The lexer and expression parser work. Nothing runs yet. Follow along in
progress.txt.
fn main() {
print("hello, world");
}
Nex aims to be a small language with a small runtime: C/Go/Rust-flavoured
syntax, static types with local inference, structs, enums and pattern matching,
and no build boilerplate. Programs are interpreted during development and
compiled to native code through LLVM (and to WebAssembly) for release. See
docs/src/content/docs/language-design.md
for the spec.
| Path | What it is |
|---|---|
crates/nex-lexer |
Source text to tokens |
crates/nex-syntax |
AST types and the parser |
crates/nex-driver |
The nex command line tool |
examples/ |
Sample .nex programs used by the test suite |
docs/ |
Language specification and documentation site |
progress.txt |
Which roadmap step is done, and what is next |
The documentation site lives in docs/ (an
Astro Starlight project):
cd docs
npm install
npm run devIt covers the language spec, the lexical structure reference, the compiler architecture and the roadmap.
Requires a stable Rust toolchain (1.83 or newer).
cargo build --workspace
cargo test --workspaceOr run the full CI suite locally:
just check # with `just` installed
./scripts/check.ps1 # Windows PowerShellThe only working subcommand today dumps the token stream:
cargo run -p nex-driver -- lex examples/hello.nexSixteen phases, from lexer to a tagged v0.1.0 release with a package manager,
language server, standard library and documentation site. Progress is tracked
one micro-step at a time in progress.txt.
| Phase | Milestone | State |
|---|---|---|
| 0 | Foundations | done |
| 1 | Lexer | done |
| 2 | AST design | done |
| 3 | Parser: expressions | done |
| 4 | Parser: statements and items | in progress |
| 5 | Tree-walking interpreter | planned |
| 6–7 | Type checker and language v0.1 | planned |
| 8–9 | LLVM and WebAssembly backends | planned |
| 10–11 | Standard library, package manager | planned |
| 12–14 | Editor tooling, LSP, docs site | planned |
| 15 | Polish and release | planned |
Nex is built in small numbered steps, one per commit, tracked in
progress.txt. If you want to take one on, open an issue
first. Bug reports, tests and docs are welcome any time. See
CONTRIBUTING.md.
Dual licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option. Contributions are accepted under the same terms.