You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move the compositional list helpers list.is_empty, list.first, and list.last from hardcoded checker/interpreter cases into exported compiler-shipped .jett source while preserving their generic collection-view signatures, ownership behavior, and empty-list behavior. This is the first slice toward the required end state: every public list.* declaration is source-owned.
Every public list.* name and signature must ultimately be declared in compiler-shipped .jett source. Compositional helpers have real Jett bodies. Source declarations may delegate allocation, indexing, mutation, sorting, and callback execution to private trusted runtime kernels, but those kernels are implementation details rather than public compiler-owned APIs. The compiler must not retain hardcoded public list names or signatures as the final architecture; the current compiler-backed surface is transitional technical debt.
This issue is a bounded first extraction slice. Follow-up work remains required for every public list operation outside the three helpers, including public declarations that front foundational length and indexing kernels.
Intended source signatures
namespace list
export function is_empty[T](view items: list[T]) returns bool
export function first[T](view items: list[T]) returns optional[T]
export function last[T](view items: list[T]) returns optional[T]
The view items: list[T] parameter is part of the contract. The source bodies may compose over private/foundational length and indexing kernels during this slice: is_empty compares length with zero, first reads index zero, and last returns none for an empty list or reads length - 1.
Scope
Includes:
Add the three exported generic declarations and real Jett bodies under compiler-shipped namespace list source.
Remove only those three redundant public checker signatures and interpreter bodies.
Preserve generic inference, explicit type arguments, optional return values, empty-list behavior, and collection-view ownership.
Add regressions proving each helper can be called and the original list then reused successfully.
Add coverage proving normal builds and symbol/signature queries resolve the helpers from compiler-shipped list source.
Keep standard-library progress, design, and architecture documentation aligned with the complete source-owned target.
Explicitly excludes:
Migrating other public list operations in this slice.
Reimplementing allocation, indexing, mutation, sorting, callback execution, or other primitive runtime behavior in Jett.
HIR, MIR, native runtime, or code-generation work.
Acceptance criteria
Compiler-shipped stdlib source exports generic list.is_empty, list.first, and list.last with the exact collection-view signatures above and real Jett bodies.
Existing empty and non-empty behavior passes for inferred and explicit generic calls.
Ownership regressions call each helper and then successfully reuse the original list; cover first and last on empty and non-empty lists and both is_empty outcomes.
Compatibility with existing implicit collection-view calls remains intact where supported.
The three helpers no longer have hardcoded public signatures in jett_typecheck or Rust execution bodies in jett_comptime.
Length/indexing behavior used by the source bodies is exposed only through the transitional foundational boundary, with follow-up retained for source-owned public declarations.
Project and dependency code still cannot reopen the builtin list namespace.
A focused query or loader regression identifies compiler-shipped list source as the definition location for at least one migrated helper.
Documentation states that all public list.* declarations become source-owned and identifies private trusted kernels as implementation details.
cargo fmt --check, cargo build, and cargo test -q pass.
Dependencies / open questions
Coordinate builtin-type namespace handling with PR #56 so string and list use one narrow compiler-shipped rule rather than parallel special cases. This work must not broaden or resolve the module/import/trusted-origin policy in #3.
This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.
Summary
Move the compositional list helpers
list.is_empty,list.first, andlist.lastfrom hardcoded checker/interpreter cases into exported compiler-shipped.jettsource while preserving their generic collection-view signatures, ownership behavior, and empty-list behavior. This is the first slice toward the required end state: every publiclist.*declaration is source-owned.Source documentation
docs/progress.md— Phase K: Full Standard Librarydocs/progress.md— Phase D: Core stdlibdocs/design.md— Rule Set 8: Extremely Dense, Opinionated Standard Librarydocs/architecture.md— Standard LibraryTarget boundary
Every public
list.*name and signature must ultimately be declared in compiler-shipped.jettsource. Compositional helpers have real Jett bodies. Source declarations may delegate allocation, indexing, mutation, sorting, and callback execution to private trusted runtime kernels, but those kernels are implementation details rather than public compiler-owned APIs. The compiler must not retain hardcoded public list names or signatures as the final architecture; the current compiler-backed surface is transitional technical debt.This issue is a bounded first extraction slice. Follow-up work remains required for every public list operation outside the three helpers, including public declarations that front foundational length and indexing kernels.
Intended source signatures
The
view items: list[T]parameter is part of the contract. The source bodies may compose over private/foundational length and indexing kernels during this slice:is_emptycompares length with zero,firstreads index zero, andlastreturnsnonefor an empty list or readslength - 1.Scope
Includes:
namespace listsource.Explicitly excludes:
Acceptance criteria
list.is_empty,list.first, andlist.lastwith the exact collection-view signatures above and real Jett bodies.firstandlaston empty and non-empty lists and bothis_emptyoutcomes.jett_typecheckor Rust execution bodies injett_comptime.listnamespace.list.*declarations become source-owned and identifies private trusted kernels as implementation details.cargo fmt --check,cargo build, andcargo test -qpass.Dependencies / open questions
Coordinate builtin-type namespace handling with PR #56 so
stringandlistuse one narrow compiler-shipped rule rather than parallel special cases. This work must not broaden or resolve the module/import/trusted-origin policy in #3.This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.