Language
AI-min source is the language surface.
Ax source is authored directly in compact parser-checked form. Standard packs and effects are inferred where the compiler can prove them.
Main Blocks And Functions
{;"hello world"}
@add(a:#,b:#):#{^a+b}
{^add(20,22)}
Records And Enums
%User{id:i64,name:str}
%%Status{Ok,Fail}
{$u=User{id:1,name:"ax"}^u.id}
Primitive Types
Ax supports i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, bool, str, void, optional forms, result-style generics, and array type references. # is the compact i32 alias.
Operators
Numeric expressions support arithmetic and comparisons. Boolean expressions use &, |, and !. Equality uses : and inequality uses !:. Boolean literals are !1 and !0.
Async
@@add(x:#,y:#):#{^x+y}
{^@(add(20,22))}
Futures and heap pointers are move-only. Reusing them after await, cancel, free, or field move produces
AX_USE_AFTER_MOVE.HTTP And TCP
&3000{G/ping>"pong" G/health>#{ok:!1,service:"ax"} P/echo>~}
&&3000{"PING\n">"PONG\n"*>"ERR\n"}
Tests
@fib(n:#):#{$i=0$a=0$b=1 ~i<n{$next=a+b a=b b=next i=i+1}^a}
?"fib"{:fib(7):13}
ax test semantically checks test files, then runs compiler-side pure test blocks from tests/**/*.ax. The v1 runner supports local bindings, identifier assignment, direct pure function calls, assertions, ?/| branches, ~ loops, and bounded loop execution.
External Packs
+acme.telemetry {telemetry.track()}