cli: add explicit static function parameters

Bind typed source functions with exact effect contracts during deterministic
specialization; retain nominal operation identity and ordinary AIR verification.

Add spec/RFC/grammar, checked Quick Reference examples, source/AIR conformance,
package/hosted CLI tests, scheduler/GC coverage and documentation budgets.
This commit is contained in:
dev committed 2026-10-07 10:23:03 +03:00
1 parent 57603860df
commit f02f4bd55b
72 files changed
+969 -25

No files matched your search

+11
View File
@@ -415,6 +415,17 @@ fn main() -> u64 effects [] {
Each required specialization is checked as concrete code; an unused template body is not a proof for future types. `Copy` gives no arithmetic or ordering operation. Read `/docs/language/generics.md` for exact Copy/Send/Share/Freeze/Local rules, deterministic keys and fixed limits; `/docs/library/std.md` for option/result contracts.
An operation is an explicit static parameter, with exact parameter/return types and effect set. Select a declared function with `fn path` (generic: `fn path::<args>`); `fn F` forwards a bound operation. It has no runtime value or captures; F is only a direct call or `task.spawn` worker. Different operations produce distinct nominal instances. Mismatch: `E7005`; escaping/shadowing F or borrowed return contracts: `E7006`. Effects and capability arguments remain explicit.
```aji
module demo.static_functions
fn identity(value: u64) -> u64 effects [] { return value; }
fn apply<T, F: fn(T) -> T effects []>(value: T) -> T effects [] {
return F(move value);
}
fn main() -> u64 effects [] { return apply::<u64, fn identity>(42u64); }
```
## 13. Linear aggregates
A struct/enum/fixed array containing owners or resources is linear. Construct with `move`; consume it completely. Read Copy fields normally. A linear enum needs exhaustive `match move`; even none must be consumed. No partial moves or automatic cleanup.