No description https://nara-lang.org
  • Zig 99.7%
  • Nix 0.2%
  • Just 0.1%
Find a file
Fernando Araoz 9e51fa1c4e
All checks were successful
narac/pipeline/head This commit looks good
feat: improve debug command help
2026-03-30 20:10:04 -05:00
design
e2e feat: improve debug command help 2026-03-30 20:10:04 -05:00
examples
src feat: improve debug command help 2026-03-30 20:10:04 -05:00
.gitignore
build.zig
build.zig.zon
CHANGELOG.md
flake.lock
flake.nix
Jenkinsfile
justfile
LICENSE
README.md

The Nara programming language

Nara is a statically typed, compiled programming language. Compiles to its own bytecode format, and runs on its own VM.

There is documentation and a WIP spec at https://nara-lang.org.

Install

This program depends on the zig stdlib and naravm, the virtual machine target.

To run from source:

  • Install the Zig programming language.
  • Run zig build run to run the debug build
  • Run zig build -Doptimize=ReleaseFast to build the final binary
  • The binary will be located at zig-out/bin/narac
  • Profit

Usage

Run nara --help to see usage.

Write source code

As of v0.0.5 the compiler is able to do:

  • Basic u64 arithmetic
  • Print strings
  • Declare & use variables
var name = "John"
print("Hello, " + name + "!")

Compile to file

Run zig build run -- c /path/to/thp/source/code > out, where out is the file to write the bytecode to. The compiler always writes to stdout.

Run bytecode

See the naravm package.

Compile & run in one command

Run zig build run -- run /path/to/nara/source/code. It will compile & run the code in one command.

Contributing

  • .path = "../naravm/"

Naming conventions

  • When importing modules, use m_<module-name>: const m_parser = @import("./parser.zig");
  • Variables that hold a token have a tok_ prefix: const tok_number = ...
  • Variables that hold a type have a t_ prefix: const t_number = ...
  • Inside structs, the reference to self is always named self, and a helper const is created: const Self = @This();