spec: accept RFC 0012 and integrate waits, channels, select and mutex

revision 2 per owner review: reserved-feature dependencies may change
until publication (general rule, DD-014); task.join.cancel returns the
handle on cancelled with loans still LOANED; channel.sender.dup from
ref<sender<T>> (MPSC, receiver_dup reserved); task.wait required by
every suspending operation, task.join included, only in modules
declaring cancellation; sent values and handles come back as block
parameters on closed/cancelled edges; explicit channel states

spec 04 §37-§41 and pointers in §11-§16, §35, §36; spec 05 §9, 07
§8.11, 07a, 08 §14, 11 §6-§7; features cancellation, channels, sync
published (implementation pending); rwlock, channel_transfer,
receiver_dup, guard_transfer reserved; effect task.wait; E4304, E4305;
Q-013 resolved; bundle +15.8 % tokens (recorded)
This commit is contained in:
dev committed 2026-10-04 16:27:38 +03:00
1 parent 4230c78dd1
commit b82bc35c5f
19 files changed
+387 -67

No files matched your search

+2 -1
View File
@@ -130,7 +130,7 @@ Effect names come from a closed registry, `reference/effects.md`, initially the
| `net.connect`, `net.listen`, `net.read`, `net.write` | `cap<net.connect>`, `cap<net.listen>`, `cap<net.read>`, `cap<net.write>` |
| `clock.read`, `random.read` | `cap<clock.read>`, `cap<random.read>` |
| `process.spawn`, `process.env` | `cap<process.spawn>`, `cap<process.env>` |
| `task.spawn`, `thread.spawn`, `thread.block` | none |
| `task.spawn`, `task.wait`, `thread.spawn`, `thread.block` | none |
| `atomic`, `atomic.weak` | none |
| `ffi`, `unsafe` | none (governed by unsafe boundaries, spec 13) |
@@ -150,6 +150,7 @@ In a module that declares `effects`:
- For every `call @g(…)` in function `f`: `effects(g) ⊆ effects(f)`, otherwise `E3101` for each missing effect.
- For every `intrinsic` in `f` (§11): the intrinsic's effect is in `effects(f)`, otherwise `E3101`.
- For every other instruction whose contract names an effect (for example `task.spawn`, `channel.make`, and in a module declaring `cancellation` every suspending operation, spec 04 §37.4): that effect is in `effects(f)`, otherwise `E3101`.
- Because every function is checked against its direct callees, the rule holds transitively, including for recursion.
**Indirect calls (normative for future features).** When function values are introduced, the effect set MUST be part of the function type, for example `fnptr<(u8) -> void effects [io.write]>`, and an indirect call is checked against that set exactly like a direct call. Otherwise dynamic calls would break transitivity.