Initial import: Aji 0.1 draft spec and Zig scaffolding

Draft specification, RFCs, reference registries and examples, plus the
reference-implementation skeleton: build.zig, diagnostic envelope with
error-code registry synced to docs, aji CLI, conformance runner with seed
tests, CI and contributor docs.
This commit is contained in:
dev committed 2026-10-04 11:59:13 +03:00
commit 17a55a7fef
67 files changed
+4197

No files matched your search

@@ -0,0 +1,22 @@
; Counting loop passing state through block parameters instead of phi nodes.
; expect: accept
; phase: 0
; spec: docs/spec/07-air.md
fn @count(%n: u64) -> u64
effects []
entry:
%zero = const.u64 0
br @loop(%zero)
loop(%i: u64):
%done = ge.u64 %i, %n
cbr %done, @exit(%i), @body(%i)
body(%j: u64):
%one = const.u64 1
%next = add.checked.u64 %j, %one
br @loop(%next)
exit(%r: u64):
ret %r
+10
View File
@@ -0,0 +1,10 @@
; Checked addition of two parameters.
; expect: accept
; phase: 0
; spec: docs/spec/07-air.md
fn @sum(%a: u64, %b: u64) -> u64
effects []
entry:
%0 = add.checked.u64 %a, %b
ret %0
@@ -0,0 +1,9 @@
; The only block falls off its end without a terminator.
; expect: reject E5002
; phase: 0
; spec: docs/spec/07-air.md
fn @f(%a: u64) -> u64
effects []
entry:
%0 = add.checked.u64 %a, %a
@@ -0,0 +1,10 @@
; add.checked.u64 applied to a u32 operand.
; expect: reject E1001
; phase: 0
; spec: docs/spec/02-types-and-values.md
fn @f(%a: u64, %b: u32) -> u64
effects []
entry:
%0 = add.checked.u64 %a, %b
ret %0
@@ -0,0 +1,10 @@
; %c is used but never defined.
; expect: reject E5001
; phase: 0
; spec: docs/spec/07-air.md
fn @f(%a: u64) -> u64
effects []
entry:
%0 = add.checked.u64 %a, %c
ret %0