rfc: 0014 accepted (revision 2) and integrated into the spec
Owner review: D1-D4, D7-D9 accepted; D5 frozen.release, no thaw; D6 arc.from_frozen (island -> frozen -> arc, one graph identity), ArcSafe (not Share alone; no arc<mutex>, no nested arc); D7 island Send, not Share; D10 islands -> heap, arc -> islands; added: never-reused graph identity, IslandSafe, the quota lifecycle, iref equality. Integrated: spec 02 §6 (IslandSafe, ArcSafe), 03 §12-§14 and new §22-§24 (instruction contracts, quota), 04 §13/§35/§38.1, 07a (features islands, arc), 15 §8 (layer 9 syntax, explicit container borrows), error codes (T0010, registered in src/diag.zig), type-properties. Phase 4 plan: P4-0, P4-1 done.
This commit is contained in:
1 parent
7d8f147d1d
commit
ca84ab4348
10 files changed
+346
-224
No files matched your search
@@ -342,6 +342,20 @@ region.reset(r);
|
||||
|
||||
Passing the region itself is `E7005`; the frontend never creates a temporary region borrow. `region.reset` and `region.destroy` end no borrow: a live allocation borrow at a reset or destroy is the verifier's `E2104`. The programmer narrows the scope.
|
||||
|
||||
**Islands, frozen graphs and arcs** (spec 03 §22–§24; layer 9). Types `island<T>`, `frozen<T>`, `arc<T>`, `iref<T>`.
|
||||
|
||||
| Source | AIR |
|
||||
|---|---|
|
||||
| `island.create(v, mem)`, `island.alloc(g, v)`, `arc.new(v, mem)` | outcome matches or `or trap` (`ok(…)`, `err(e: alloc_error)`) |
|
||||
| `island.root(g)`, `frozen.root(g)`, `arc.root(g)` | `island.root`, `frozen.root`, `arc.root` |
|
||||
| `ref x = island.at(g, r);` / `mut x = island.at(g, r);` | `island.borrow` (`mut` needs `g: mut<island<T>>`) |
|
||||
| `ref x = frozen.at(g, r);`, `ref x = arc.at(g, r);` | `frozen.borrow`, `arc.borrow` (`mut` is `E7005`) |
|
||||
| `island.freeze(move i)`, `island.destroy(move i)`, `frozen.release(move f)`, `arc.from_frozen(move f)`, `arc.release(move a)` | the same |
|
||||
| `arc.clone(a)` | `arc.clone` on a shared borrow of `a`, made for the operation |
|
||||
| `a == b`, `a != b` for `iref<T>` | `iref.eq` (then `not`) |
|
||||
|
||||
**Container borrows are explicit, as for regions.** `.root`, `.at` and `island.alloc` take a named borrow binding of the graph's owner (`mut g = isl;`), which outlives the borrows derived from it. Passing the owner itself is `E7005`, with a hint. A container borrow written inline is `E7006`. `island.at`, `frozen.at` and `arc.at` appear only as the place of a `ref`/`mut` binding (`E7006` elsewhere).
|
||||
|
||||
**Linear aggregates.** A struct or enum with a linear field (`own<T>`, `region`, a resource) needs the reserved feature `linear_aggregates`. The frontend lowers it as written and the AIR is rejected (`E0006`) until that feature is published.
|
||||
|
||||
A byte string or array used where a `slice<u8>` is expected is materialized in frame storage and borrowed for the operation.
|
||||
|
||||
Reference in new issue
Block a user