Skip to content

Define standard-library layering and public API contracts #375

Closed

Description

@LunaStev

Problem

The Wave standard library currently mixes raw operating-system primitives, descriptor helpers, and user-facing APIs. Names such as fs_open inside std::fs::file repeat module context, while functions such as fs_read_all expose caller-managed buffer contracts that are not obvious from their names.

The public boundary should be decided before broad API expansion.

Proposed layers

  • std::sys: target-specific operating-system primitives and ABI contracts.
  • std::io: descriptor, stream, buffering, and byte transport helpers.
  • std::fs: user-facing file and directory operations.
  • std::libc: explicit C library bindings, separate from direct system providers.

std::sys may contain source-auditable platform work before the compiler can execute that target. Unsupported targets must remain clearly gated and must not be advertised as runnable.

Decisions required

  • Naming and prefix rules inside namespaced modules.
  • Public re-export policy between sys, io, fs, net, process, and time.
  • Path-based versus descriptor-based operation names.
  • Error conventions before and after runtime variant lowering is available.
  • Ownership rules for strings, buffers, handles, and allocated results.
  • Compatibility and migration policy for pre-beta API changes.

Workstreams

Completion criteria

  • A short standard-library architecture document defines every layer.
  • Public naming and re-export rules are explicit.
  • Raw platform APIs cannot be mistaken for portable APIs.
  • File I/O examples map clearly to their declared signatures.
  • Follow-up implementation issues cite this contract.

Activity

  1. added
    enhancement
    discussion
    on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions