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

+2 -2
View File
@@ -41,8 +41,8 @@ Lowering layers (P6A-3/4), each with accepted (golden AIR), rejected (`E7xxx`) a
| 1 | scalars, expressions, functions, control flow, variables carried across joins, short-circuit `and`/`or`, casts | done |
| 2 | structs (named construction, declaration-order lowering), enums (`Enum::Variant`), exhaustive `match` over enums (no `_`) and integers (`_` required), `match` as an expression; outcome matches and `or trap` move to layer 5 with the fallible operations | done |
| 3–4 | addressable values (frame storage chosen by lowering), lexical borrows (`ref r = …;`/`mut r = …;`), places and writes, arrays, slices, `split_at`, `slice.copy`, byte strings, proven indexing for the verifier's fact form; `move` comes with linear values in layer 5 | done |
| 5 | `own`, regions, resources, unsafe | todo |
| 6 | capabilities, intrinsics, I/O | todo |
| 5 | explicit `move` for linear values (`E7003` with the `move x` hint), `own`/`own_array`, regions with an explicit region borrow, outcome matches (match kind decided by the parser), `or trap`, built-in error enums, `cap<mem.alloc>` and `cap.narrow.budget`; linear aggregates stay rejected (`E0006`); `aji lower --stats` reports `mechanical_air_eliminated` | done |
| 6 | host capabilities and grants, intrinsics, I/O, resources (`file`, `stream`, `listener`), `cap.narrow.prefix`, `trusted`/unsafe | todo |
| 7 | tasks, channels | todo |
| 8 | `lock`, `select`, cancellation, shields | todo |