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:
1 parent
57603860df
commit
f02f4bd55b
72 files changed
+969
-25
No files matched your search
@@ -117,3 +117,5 @@ RFC 0026 std.hash (cl100k, relative to Deque): Quick Reference 7,747 → 7,806 (
|
||||
RFC 0027 explicit error values (cl100k, relative to hashes): Quick Reference 7,806 → 7,863; other source docs 47,475 → 48,061; full source excluding AIR 55,281 → 55,924 (+1.2%). AIR is 179,282 bytes / 51 sections, and its source-bundle copy is 46,300 tokens. The measurement excludes the developing map contract. Existing variant syntax gains pure built-in error values; no authority, resource or ownership state is added. Cumulative source growth is +64.6%; the RFC records the complexity justification, without claiming MCC improvement.
|
||||
|
||||
RFC 0028 numeric-key owning map (cl100k, relative to error_values; includes the separate integer-pattern clarification): Quick Reference stays 7,863, other source docs 48,061 → 50,079, full source excluding AIR 55,924 → 57,942 (+3.6%). The on-demand library page is 14,167 tokens. AIR remains 179,282 bytes / 51 sections. No map-specific instruction, source form, verifier state or diagnostic is added; general keys remain Q-037. Cumulative source growth is +70.5%, with review justification in the RFC and no claimed MCC benefit.
|
||||
|
||||
RFC 0029 static function parameters (cl100k, relative to numeric maps): Quick Reference 7,863 → 8,051 (+2.4%); other source docs 50,079 → 51,002 (+1.8%); full source excluding AIR 57,942 → 59,053 (+1.9%). language/generics.md is 2,194 tokens; AIR remains 179,282 bytes / 51 sections. One explicit operation-selection concept adds two source forms and bounded frontend state, with no runtime/verifier state or new AIR construct/diagnostic. Cumulative growth is +73.8%; the RFC justifies the general hash/equality/order prerequisite, keeps general collections open and makes no empirical MCC claim.
|
||||
@@ -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.
|
||||
|
||||
@@ -31,6 +31,7 @@ docs/spec/03-memory-model.md :: ## 26. Dynamic initialized buffers
|
||||
|
||||
> language/generics.md
|
||||
docs/spec/15-source-language.md :: ## 15. Explicit source generics
|
||||
docs/spec/15-source-language.md :: ## 18. Static function parameters
|
||||
|
||||
> language/modules.md
|
||||
docs/spec/15-source-language.md :: ## 14. Package source modules
|
||||
|
||||
@@ -11,7 +11,7 @@ The other files in `/docs` hold the full rules. Open one only when this page is
|
||||
| built-in bytes/math/text/formatting/hash, option/result, owning Vec and Deque, signatures and failure contracts | `/docs/library/std.md` |
|
||||
| initialized buffer storage, explicit growth/drain and child views | `/docs/language/buffers.md` |
|
||||
| whole-value linear aggregates, unpack, exchange and allocation failure | `/docs/language/linear-aggregates.md` |
|
||||
| generic declarations/applications, property constraints and specialization limits | `/docs/language/generics.md` |
|
||||
| generic declarations/applications, property constraints, static function contracts and specialization limits | `/docs/language/generics.md` |
|
||||
| explicit package imports, qualified types, manifest file inputs | `/docs/language/modules.md` |
|
||||
| exact syntax, every construct, `match` and outcomes | `/docs/language/syntax.md` |
|
||||
| integer semantics, conversions, Copy/Send/Share, traps | `/docs/language/types.md` |
|
||||
|
||||
Reference in new issue
Block a user