No description https://nara-lang.org
  • Zig 99.9%
  • Just 0.1%
Find a file
Fernando Araoz 60f3a03e5a
Some checks failed
narac/pipeline/head There was a failure building this commit
rework: restore minimal operator handling
- define number upcasting rules
- reenable `+` operator
- typecheck fun defs
- typecheck callers
- codegen fun defs
- codegen callers
2026-06-01 10:16:30 -05: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 rework: restore minimal operator handling 2026-06-01 10:16:30 -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 rework: restore minimal operator handling 2026-06-01 10:16:30 -05:00
CHANGELOG.md
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();