Skip to content

Phase 3: grow the PureScript standard library #76

Open
2 of 3 issues completed
Open

Description

@biuld

Why this phase

230 of the 377 unresolved passing files are blocked on nothing but a missing library module. They parse, and the only thing standing between them and resolution is code we have not written.

Measured, by first blocking module:

Missing module passing files blocked
Prelude 163
Effect.Console 64
Data.Symbol, Data.Unit, Effect 3
Test.Assert 29 imports
Type.Proxy 17 imports
Partial.Unsafe 12 imports
Data.Tuple 8 imports
Prim.Row 7 imports

stdlib/lib currently holds 12 modules: Prelude, Data.Maybe, Data.Either, and the WASI services. Prelude is six declarations (pure, bind, discard, map, apply, runEffect over a foreign import data Effect). The corpus expects show, Eq/Ord, Functor/Apply/Applicative, tuples, Boolean combinators, folds, and string operations.

This is also the ratchet #66 asked for and that issue's own "not a big bang" rule: grow the library one group at a time, keep CI green at each step, and let each new library construct drive the frontend features it needs.

Scope

  • Prelude: the classes and instances the corpus expects (Show, Eq, Ord, Functor, Apply, Applicative, Foldable, Semigroup, Monoid), tuples as closed records, Boolean combinators, folds, String/Char/Number conversions.
  • Effect and Effect.Console as a surface over the existing WASI.Console, matching what the corpus imports.
  • Test.Assert (assert, assertEqual, assertThrows, …) so passing assertions run unchanged.
  • Type.Proxy, Partial.Unsafe, Prim.* where the library needs them.
  • Each library addition names the FE rows it exercises and lands its frontend prerequisites in the same phase.

Every module must compile and execute under Wasmtime, not only type-check.

Gate

passing files blocked solely on a missing library module drop to zero, and the stdlib capability matrix in docs/design/backend/wasm/wasi-platform-library.md lists each module with its FE/BE owner.

Sub-issues

Tracked as children of this epic.

References

  • stdlib/lib/ — current library, trusted prefix order
  • crates/psrs-driver/src/prelude.rs — disk loader for stdlib/lib
  • docs/design/backend/wasm/wasi-platform-library.md — capability layout and matrix
  • docs/design/D-04-suite-roadmap.md — M7, BE-26, BE-27

Validation

cargo fmt --all --check
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
PSRS_REQUIRE_WASMTIME=1 cargo test --workspace
PSRS_ORACLE=annotations cargo test -p psrs-driver --test suite l2_resolution -- --ignored --nocapture

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions