Novus is a small, statically-typed systems language that compiles directly to native machine code. It targets darwin/arm64, linux/amd64, linux/arm64, linux/x86 and windows/amd64 today.
Status: active development. The language is stable enough to write real command-line apps (see Todo-App and stopwatch), but expect rough edges.
Automatic:
curl -fsSL https://raw.githubusercontent.com/MJDaws0n/novus/main/install.sh | bashManual: grab a binary for your platform from the
releases page and put it on your PATH.
sudo cp novus_<your-platform> /usr/local/bin/novus
sudo chmod +x /usr/local/bin/novus
# macOS only:
sudo xattr -d com.apple.quarantine /usr/local/bin/novusIt is strongly recommended to also install the package manager, Nox.
nox init my-app
cd my-app
novus main.nov
./build/<target>/my-appnox init already adds the standard library (std) by default. The starter
main.nov looks like:
module my_app
import lib/std std;
fn main() -> i32 {
std.print("Hello, world!");
std.exit(0);
return 0;
}
module example
import lib/std std;
fn greet(name: str) -> void {
std.print("Hi " + name);
}
fn greet(times: i32) -> void { // function overloading
let i: i32 = 0;
while (i < times) {
std.print("Hi!");
i += 1; // compound assignment
}
}
fn main() -> i32 {
greet("Max");
greet(3);
let xs: []i32 = [1, 2, 3];
std.print(std.to_str(std.len(xs))); // unified len/to_str
std.exit(0);
return 0;
}
See docs/docs.md for the full language reference.
go run cmd/novus/main.go --target=darwin/arm64 path/to/file.novlinux/amd64,linux/386need NASM +ld.linux/arm64needsaarch64-linux-gnu-asandaarch64-linux-gnu-ldwhen the host is not arm64.windows/amd64needs NASM + GoLink (orlink.exe).darwin/arm64needs Apple'sas/ld(i.e. Xcode CLT) or a darwin cross toolchain.
Artifacts are written to build/<target>/. Valid target names:
darwin_arm64, linux_x86_64, linux_x86, linux_arm64, windows_x86_64.
cmd/novus/— compiler CLI entry pointinternal/— lexer, parser, semantic analysis, IR, codegendocs/— language and library referencedocs/notes/— developer notes / learning materialvscode-novus/— VS Code syntax extensionexamples/— example apps and tiny libraries