Phase 6A: .aji layer 5 (linear values, own, regions, outcome matches, or trap)

- explicit move for named linear values; E7003 with suggestion "move x";
  move of a copyable value is E7006; moved state left to the verifier
- own.new/own.array/region.create/region.new/region.array/cap.narrow.budget
  as outcome matches or with `or trap`; own.take/own.free/region.reset/
  region.destroy as AIR names in AIR operand order
- region.new/region.array take an explicit ref/mut region binding (E7005
  otherwise); reset/destroy end nothing (verifier E2104)
- match kind (enum/outcome/integer) decided by the parser; built-in error
  enums (alloc_error, cap_error, io_error) matched exhaustively
- cap<K> types; linear owners borrowed in place
- features header = registry closure of the features used
- parameters keep their source names (grants by @main parameter name)
- aji lower --stats: mechanical_air_eliminated = 1 - source/AIR bytes
- spec 15, grammar, quick reference, plan updated
This commit is contained in:
dev committed 2026-10-05 12:06:23 +03:00
1 parent eca30f817a
commit bdcf871e5d
28 files changed
+882 -78

No files matched your search

+3 -1
View File
@@ -39,6 +39,8 @@ int_type = "u8" | "u16" | "u32" | "u64" | "u128" | "usize"
| "i8" | "i16" | "i32" | "i64" | "i128" | "isize" ;
(* `region`, `listener`, `stream`, `io_error`, `alloc_error`,
`cap_error` are built-in type names (ident). *)
(* A built-in operation is a call whose callee is a dotted path:
`own.new(v, mem)`, `region.new(arena, v)`, `cap.narrow.budget(c, n)`. *)
block = "{" { statement } [ expr ] "}" ; (* optional tail expression: the block's value *)
statement = "let" binding [ ":" type ] "=" expr ";"
@@ -92,5 +94,5 @@ field_init = ident ":" expr ;
place = ident { "." ident | "[" expr [ ".." expr ] "]" } | "*" unary ;
int_lit = digit { digit | "_" } [ int_type ] | "0x" hexdigit { hexdigit | "_" } [ int_type ] ;
string = 'b"' { char | escape } '"' ; (* byte string; escapes \n \t \\ \" \xHH *)
string = 'b"' { char | escape } '"' ; (* byte string; escapes \n \r \t \0 \\ \" \xHH *)
ident = ( letter | "_" ) { letter | digit | "_" } ;