spec: accept RFC 0007 and integrate I/O and linear resources
- spec 06 §6-§7: feature resources, consumption and verifier rules, io_error - spec 05 §11.1 fallible intrinsic form; spec 07 §8.7 frozen built-in enum variants, §8.9 resource types; spec 07a resources and run record fields; spec 11 §8 execution profiles, blocked outcome, result channel - reference/intrinsics.md: formal catalogue; capabilities.md: io_error and fs prefix narrowing - features: resources published, linear_aggregates reserved
This commit is contained in:
1 parent
c7bcea294e
commit
571cc6e362
9 files changed
+199
-83
No files matched your search
@@ -222,7 +222,11 @@ Rules: spec 05 §9–§12. Decision record: RFC 0006.
|
||||
| `cap.narrow.<form> %c, %arg…, ok -> @ok, err -> @err` (terminator) | `cap<K>`, form arguments | form registered for `K` (`E3202`); `@ok` has one parameter `cap<K>`, `@err` one parameter `cap_error` (`E5002` count, `E1001` type) | continues at `@ok` with a narrower capability sharing nothing wider than `%c`, or at `@err` with the reason; never traps |
|
||||
| `[%r =] intrinsic <name>(%a…)` | per registry entry | operand types (`E1001`), capability kind (`E3201`), effect (`E3101`), borrows as for `call`; unknown name `E0004` | forwards to the host through the capability |
|
||||
|
||||
No intrinsic is registered yet (RFC 0007). Effect checking applies to `call` and `intrinsic` in modules that declare `effects` (spec 05 §9.3).
|
||||
Intrinsics have an infallible form (`[%r =] intrinsic …`) and a fallible terminator form (`intrinsic …, ok -> @ok, err -> @err`) (spec 05 §11.1). The catalogue is `reference/intrinsics.md`. Effect checking applies to `call` and `intrinsic` in modules that declare `effects` (spec 05 §9.3).
|
||||
|
||||
## Feature `resources`
|
||||
|
||||
Resource types and their consumption rules: spec 06 §6. Resources are used through `borrow.ref`/`borrow.mut` (which accept a resource value as root) and consumed by closing intrinsics, by-value resource parameters, resource block parameters and `ret`.
|
||||
|
||||
## Run result
|
||||
|
||||
@@ -238,4 +242,4 @@ No intrinsic is registered yet (RFC 0007). Effect checking applies to `call` and
|
||||
|
||||
On a trap it reports `{"status":"trapped", "code":…, "kind":…, "function":…, "block":…, "inst":…}` (spec 01 §6).
|
||||
|
||||
When instantiation fails (spec 05 §10.2) the program does not start and the runner reports `{"status":"not_instantiated","reason":…,…}`. When the runner stops execution because an execution limit is exhausted (spec 11 §7), it reports `{"status":"limit_exceeded","kind":"fuel","limit":N,"steps":N}`. This is an outcome of the execution environment, not of the program, and is not a trap.
|
||||
Programs that declare `capabilities` also get `"stdout"` and `"stderr"` (captured output) and `"files"` (files written in the virtual file system) in the record of the `deterministic` profile (spec 11 §8). When the deterministic runtime detects quiescence it reports `{"status":"blocked","kind":"no_future_event",…}` (spec 11 §8). When instantiation fails (spec 05 §10.2) the program does not start and the runner reports `{"status":"not_instantiated","reason":…,…}`. When the runner stops execution because an execution limit is exhausted (spec 11 §7), it reports `{"status":"limit_exceeded","kind":"fuel","limit":N,"steps":N}`. This is an outcome of the execution environment, not of the program, and is not a trap.
|
||||
Reference in new issue
Block a user