docs(stdlib): add the CkLang stdlib spec files; reconcile plans #61
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/061-docs-stdlib-add-the-cklang-stdlib-spec-files-r"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
docs(stdlib): add the CkLang stdlib spec files; reconcile plans
Along the way:
Touches 28 files:
.claude/commands/orchestrate.md,Alloc.ck,CLAUDE.md,Floor.ck,LiteralDSL.ck,Operators.ckand 22 more.Happy with this. I ran the suite against the branch and it is green,
src/rust/crates/ck_docs_linkchecker/src/lib.rsincluded.@ -0,0 +282,4 @@impl BitAnd<bit, bit, bit> { fn band(a: bit, b: bit) -> bit = Floor.band(a, b) }trait BitOr<A, B, R> {fn bor(a: A, b: B) -> Rborreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -0,0 +83,4 @@needs no primitive variant — the `ItemRef` change the old step planned is moot.)- **Step 2 — route nominal receivers through the arity key.** With scalars now`Ty::Nominal` (3b), `resolve_method_call` already reaches `coherence.traits_for`for them (`ck_types/src/method_call.rs:325`); the old `_ => Vec::new()` arm thatThe catch-all arm means a variant added later compiles and lands here without a word. Can the match on
themname every variant so the compiler tells us?@ -94,0 +95,4 @@// history but never leading (see `plan.md` "Deferred / archived"). Their// links point at the pre-restructure layout on purpose, so the archive is// out of scope for the link gate — only live docs must stay linked.let archived = docs_root.join("old");I had to read
archivedtwice. Nothing wrong with it, but one line of comment would save the next person the second read.Comment added on
archivedinsrc/rust/crates/ck_docs_linkchecker/src/lib.rs. It was obvious when I wrote it and it will not be in a month.Split. The decision in
boris a pure function now, with its own tests inPrelude.ck.Named them all. A new variant is a compile error in
slice_traits.mdnow, which is where we want to find out.Introduce the always-linked stdlib as manifest CkLang spec drafts and align the plan leaves to them. New .ck spec files: - Floor.ck — the closed 1:1 machine floor + the one `tick` event-loop grain - Types.ck — aliases (Int=i64), base value types (String/List/Map/Set), Option, the Error trait tier, and world-types (Color/Money/Geo) with one uniform impl form and concrete per-tag impls - Prelude.ck — the operator-trait tier, one impl per concrete primitive - Operators.ck — the operator symbol / precedence table Plan reconciliations (soll aligned to the .ck files): - Eq -> Equals everywhere (Equals is the trait; Eq is not a CkLang trait) - size_of is not a floor leaf (compile-time iconst); floor roster completed (negate/remainder/bitwise/shift/float families) - Int/Float are `type` aliases (i64/f64 sugar), not distinct primitives - retire "Preamble" -> "Types.ck" / the always-linked stdlib units - move write(String)/openat(String) off the floor; keep byte-level leaves Types.ck design rulings (owner): - no blanket impls — Money expands to concrete per-currency impls; unlocked rosters (Length units, temporal reps) are honest stubs, not invented sweeps - Literal is Form A (`impl Literal<T>`), never `impl … for T` - closed `data Currency` tag (Money<USD>) is the currency-safety, not String<3> Also carries pre-existing working-tree changes: the workspace `dead_code = "deny"` gate in Cargo.toml and the removal of prompt.md.Add the low-level types Floor.ck / Memory / Clock speak in, so the floor is a fully type-checkable unit with no compiler-known atom beyond Unit/Nothing: - usize alias to u64 (pointer/offset width, bootstrap target) - Region record { offset, size } — a fenced span carrying its own bound (plan_values_02 §4's (position,length) shape, at the region tier) - Handle usize position (Region base + byte offset); NOT generic — the element type rides Floor.load<T>/store<T>, not the handle - TickHandle opaque one-word receipt from Floor.tick, for defer teardown Function<Ret> is intentionally NOT declared: CkLang has no syntax yet for a compile-time-only type with no runtime representation (pending owner decision on the declaration form; the earlier `comptime: true` marker was an invented Zig-ism and is removed). Also carries the in-progress temporal roster already in the working tree: Date/Time/DateTime + TimeSpan/DateSpan over the output-typed Sub<A,B,R> op form.