Skip to content

Define standard-library layering and public API contracts #375

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionIssues that require a technical or community discussion.enhancementA request for a new feature or improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions