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 set helpers set.is_empty, set.union, set.intersection, and set.difference from hardcoded checker/interpreter cases into an exported compiler-shipped .jett set module while preserving their current generic signatures, membership results, and iteration-derived result order. Keep equality, storage, and cardinality operations as Rust-backed kernels.
The four helpers are implemented and behaviorally covered, but there is no stdlib/set.jett. Their public generic signatures remain hardcoded in jett_typecheck, and their bodies remain Rust match arms in jett_comptime.
The language can express this bounded slice compositionally:
is_empty[T] can compare the retained set.length[T] kernel with zero.
union[T] can start with the left set and add each right-side item through the retained set.add[T] kernel.
intersection[T] and difference[T] can iterate the left set and select items through the retained set.contains[T] kernel.
The existing interpreter stores sets in insertion order. Source implementations should preserve the current observable order when results are later passed to set.to_list: union keeps left-side order before novel right-side items, while intersection and difference retain left-side order.
Scope
Includes:
Add an exported namespace set stdlib source surface for is_empty, union, intersection, and difference.
Remove only those four redundant checker signatures and interpreter bodies.
Preserve generic inference, explicit type arguments, membership behavior, deduplication, and the current iteration-derived result order.
Add regression coverage proving normal builds and symbol/signature queries resolve the migrated helpers from compiler-shipped set source.
Keep standard-library progress, design, and architecture documentation aligned with the resulting boundary.
Explicitly excludes:
Reimplementing the foundational set.new, set.add, set.remove, set.contains, or set.length equality/storage kernels.
Migrating set.to_list or defining a new language-level set ordering guarantee.
Project and dependency code still cannot reopen the builtin set namespace.
A focused query or loader regression identifies the compiler-shipped set source as the definition location for at least one migrated helper.
docs/design.md, docs/architecture.md, and docs/progress.md distinguish source-hosted set helpers from retained kernels.
cargo fmt --check, cargo build, and cargo test -q pass.
Dependencies / open questions
Coordinate builtin-type namespace handling with PR #56 and issue #57 so string, list, and set 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 set helpers
set.is_empty,set.union,set.intersection, andset.differencefrom hardcoded checker/interpreter cases into an exported compiler-shipped.jettset module while preserving their current generic signatures, membership results, and iteration-derived result order. Keep equality, storage, and cardinality operations as Rust-backed kernels.Source documentation
docs/progress.md— Phase K: Full Standard Librarydocs/progress.md— Phase D: Core stdlibdocs/active/stdlib_json_extraction_plan.md— current compiler-aware builtin surfacesdocs/architecture.md— Standard LibraryCurrent state
The four helpers are implemented and behaviorally covered, but there is no
stdlib/set.jett. Their public generic signatures remain hardcoded injett_typecheck, and their bodies remain Rust match arms injett_comptime.The language can express this bounded slice compositionally:
is_empty[T]can compare the retainedset.length[T]kernel with zero.union[T]can start with the left set and add each right-side item through the retainedset.add[T]kernel.intersection[T]anddifference[T]can iterate the left set and select items through the retainedset.contains[T]kernel.The existing interpreter stores sets in insertion order. Source implementations should preserve the current observable order when results are later passed to
set.to_list: union keeps left-side order before novel right-side items, while intersection and difference retain left-side order.Scope
Includes:
namespace setstdlib source surface foris_empty,union,intersection, anddifference.Explicitly excludes:
set.new,set.add,set.remove,set.contains, orset.lengthequality/storage kernels.set.to_listor defining a new language-level set ordering guarantee.Acceptance criteria
set.is_empty,set.union,set.intersection, andset.differencewith their existing signatures.jett_typecheckor Rust execution bodies injett_comptime.set.new,set.add,set.remove,set.contains,set.length, andset.to_listremain explicit Rust-backed kernels.setnamespace.docs/design.md,docs/architecture.md, anddocs/progress.mddistinguish source-hosted set helpers from retained kernels.cargo fmt --check,cargo build, andcargo test -qpass.Dependencies / open questions
Coordinate builtin-type namespace handling with PR #56 and issue #57 so
string,list, andsetuse 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.