Phase 6A: .aji layer 6 (intrinsics, resources, narrowing, unsafe operations)

- intrinsics from the registry as plain calls: fallible ones are outcome
  matches or `or trap` (E7006 otherwise), infallible ones plain calls
- resource operands by name, borrowed mut for the one operation and ended
  on every edge; a mut binding/parameter passes as is; `mut f` is E7006
- closes consume with `move` (E7003); no inserted closes (E3002/E3001)
- data operands explicit (ref/mut/byte string, E7005 otherwise)
- file<…>, stream, listener types; cap.narrow.prefix with cap_error edges
- ref/mut unchecked s[i] (also as a binding) and assume(c) under
  effects [unsafe]; boundary left to the verifier (E6001)
- trusted is reserved and rejected (E7006)
- parameter names preserved; generated names avoid them (normative)
- parser: >> closes two type arguments
- conformance: `equivalent:` compares the run record with a reference
  AIR program (hello, file_copy, tcp_echo, narrow ok/not_subset/invalid,
  random)
- spec 15, grammar, quick reference (io_error match fixed), plan, examples
This commit is contained in:
dev committed 2026-10-05 12:16:54 +03:00
1 parent bdcf871e5d
commit c18fb7acc1
39 files changed
+1309 -69

No files matched your search

+3 -2
View File
@@ -24,8 +24,7 @@ variant = ident [ "(" type { "," type } ")" ] ;
fn_decl = "fn" ident "(" [ param { "," param } ] ")" "->" type [ "from" ident ]
"effects" "[" [ path { "," path } ] "]"
[ "trusted" string ]
block ;
block ; (* `trusted` is reserved and rejected, E7006 *)
param = ident ":" type ;
type = int_type | "bool" | "void" | "never" | ident
@@ -33,6 +32,7 @@ type = int_type | "bool" | "void" | "never" | ident
| wrapper "<" type ">"
| "cap" "<" path ">"
| "file" "<" ( "read" | "write" | "append" ) ">" ;
(* `>>` closes two type arguments: mut<file<write>> *)
wrapper = "ref" | "mut" | "slice" | "slice_mut" | "own" | "own_array"
| "task" | "sender" | "receiver" | "mutex" ;
int_type = "u8" | "u16" | "u32" | "u64" | "u128" | "usize"
@@ -45,6 +45,7 @@ int_type = "u8" | "u16" | "u32" | "u64" | "u128" | "usize"
block = "{" { statement } [ expr ] "}" ; (* optional tail expression: the block's value *)
statement = "let" binding [ ":" type ] "=" expr ";"
| "var" ident ":" type "=" ( expr | "zero" ) ";"
| ( "ref" | "mut" ) [ "unchecked" ] ident "=" place ";" (* borrow binding *)
| place "=" expr ";"
| "break" ";" | "continue" ";" | "return" [ expr ] ";" | "trap" ";"
| expr ";"