No description https://nara-lang.org
  • Zig 99.9%
  • Just 0.1%
Find a file
Fernando Araoz e595556cae
All checks were successful
narac/pipeline/head This commit looks good
Merge pull request 'update jenkinsfile' (#24) from develop into main
Reviewed-on: #24
2026-06-24 14:12:29 +00:00
design
e2e feat: prep work on function declaration 2026-05-27 12:12:20 -05:00
examples test: e2e files for testing 2026-03-06 22:36:26 -05:00
src cli(AI): use new vm build/run/serialize flows 2026-06-23 16:40:35 -05:00
.gitignore feat: start work on 0.16.0 migration 2026-04-24 13:13:35 -05:00
build.zig feat: wipe visitors off the face of the codebase 2026-05-27 13:00:48 -05:00
build.zig.zon cli(AI): use new vm build/run/serialize flows 2026-06-23 16:40:35 -05:00
CHANGELOG.md feat: reenable ref allocation & type saving in typecheckin 2026-01-28 17:30:39 -05:00
Jenkinsfile ci: update jenkinsfile 2026-06-24 09:05:45 -05:00
justfile feat: e2e runner colors 2026-03-06 21:44:41 -05:00
LICENSE
README.md feat: else codegen 2026-03-06 19:53:34 -05:00

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();