Get Started
From zero to compiled ARIA-IR in under ten minutes.
Prerequisites
Install
Download a prebuilt JAR. Requires Java 11+ but not the Clojure CLI.
# Download the latest release
curl -LO https://github.com/jhavera/aria-clj/releases/latest/download/aria-clj.jar # Type-check an ARIA-IR file
java -jar aria-clj.jar examples/fibonacci.aria --check
# Emit C to stdout
java -jar aria-clj.jar examples/fibonacci.aria --emit-c
# Full pipeline: parse, check, compile, execute
java -jar aria-clj.jar examples/fibonacci.aria --run Or build the uberjar yourself: clj -T:build uber
Hello World
Create a file called hello.aria:
(module "hello"
(func $main
(result i32)
(effects io)
(intent "Print hello world")
(print "Hello, world!\n")
(return 0))
(export $main)) Compile and run with the Clojure CLI:
$ clj -M:run hello.aria --run
Hello, world! Or, if you have the downloaded JAR and only need Java:
$ java -jar aria-clj.jar hello.aria --run
Hello, world! ariac: Self-Hosted Compiler
ariac is the reference ARIA-IR compiler, written in ARIA-IR itself across 6 modules (~5220 LOC). It supports multi-module programs, compile-time memory safety, and mandatory intent annotations. The Clojure implementation serves as the initial bootstrap only.
Two-stage build:
# Stage 1: build ariac-bootstrap from the Clojure compiler
clojure -M:run aria-src/ariac-bootstrap.aria --emit-c -o /tmp/bootstrap.c
gcc -std=c99 -fwrapv -o ariac-bootstrap /tmp/bootstrap.c -lm
# Stage 2: build ariac from ariac-bootstrap
./ariac-bootstrap aria-src/ariac/main.aria --emit-c -o /tmp/ariac.c
gcc -std=c99 -fwrapv -o ariac /tmp/ariac.c -lm Use ariac to compile any ARIA program:
# Single-module program
./ariac examples/fibonacci.aria --run
# Multi-module program
./ariac examples/import_demo/main.aria --run
# Verify bootstrap: ariac compiles itself
./ariac aria-src/ariac/main.aria -o ariac2
./ariac2 examples/fibonacci.aria --run Troubleshooting
gcc not found
The --run and --emit-c flags require gcc. On macOS, install Xcode Command Line Tools: xcode-select --install. On Linux: apt install gcc or equivalent.
Clojure CLI not found
Follow the official install guide. On macOS: brew install clojure/tools/clojure.
Something else?
Open an issue on GitHub or ask in Discussions.