Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions std/POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ This document defines non-negotiable rules for the Wave standard library (`std/`

## 1) Layering Rules

- `std/libc/**` is the only directory allowed to declare `extern(c)`.
- Outside `std/libc/**`, modules must use Wave code and/or `std/sys/**` raw syscall wrappers.
- High-level modules (`std/io`, `std/fs`, `std/net`, `std/process`, `std/mem`, etc.) must not import `std::libc::*`.
- General-purpose C library bindings belong in external libraries, not `std/`.
- `extern(c)` declarations are limited to the target-specific C ABI providers
explicitly approved by `tools/check_std_policy.py`. This includes hosted OS
APIs and WASI imports; it does not require replacing existing OS bindings.
- Portable modules use Wave code and the target-selected `std/sys/**` provider
surface. No standard library module may import the removed `std::libc::*`
binding modules.

## 2) Syntax Rules

Expand Down Expand Up @@ -37,6 +41,6 @@ Run:

The checker validates:

- `extern(c)` appears only under `std/libc/**`
- no `std::libc::*` import outside `std/libc/**`
- `extern(c)` appears only in explicitly approved target C ABI providers
- no `std::libc::*` import in standard library modules
- no retired `let` or `let mut` declarations in Wave sources
10 changes: 8 additions & 2 deletions std/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ licensed under the repository's [Mozilla Public License 2.0](../LICENSE).

## Dependency Policy

- General-purpose `extern(c)` bindings belong under `std/libc/*`.
- General-purpose C library bindings are not bundled with the standard library.
- Target providers under `std/sys/*` may use the small set of hosted C ABI
bindings explicitly approved by `tools/check_std_policy.sh` when the OS does
not expose an equivalent stable raw syscall contract.
Expand All @@ -25,9 +25,15 @@ licensed under the repository's [Mozilla Public License 2.0](../LICENSE).
environment access, process exit, and linear-memory allocation. The allocator
is also available to bare `wasm32-unknown-unknown` modules. A separate
Memory64 allocator backs `wasm64-unknown-unknown` without narrowing pointers.
- Modules outside `std/libc/*` must not import `std::libc::*`; portable modules
- Standard library modules must not import `std::libc::*`; portable modules
depend on the target-independent `std::sys::*` provider surface instead.

The former `std::libc::*` binding modules have been removed during alpha
development. Existing imports of these modules no longer resolve. Use the
relevant Wave standard library APIs, or provide C interoperability bindings in
an external library for the required target ABI. The target providers under
`std::sys::*` retain their existing OS API bindings.

## Core Modules

- `std::time`: portable clocks and sleep, normalized durations, UTC calendar
Expand Down
25 changes: 0 additions & 25 deletions std/libc/arpa.wave

This file was deleted.

22 changes: 0 additions & 22 deletions std/libc/errno.wave

This file was deleted.

37 changes: 0 additions & 37 deletions std/libc/netinet.wave

This file was deleted.

39 changes: 0 additions & 39 deletions std/libc/poll.wave

This file was deleted.

66 changes: 0 additions & 66 deletions std/libc/socket.wave

This file was deleted.

26 changes: 0 additions & 26 deletions std/libc/stdio.wave

This file was deleted.

35 changes: 0 additions & 35 deletions std/libc/stdlib.wave

This file was deleted.

27 changes: 0 additions & 27 deletions std/libc/string.wave

This file was deleted.

36 changes: 0 additions & 36 deletions std/libc/time.wave

This file was deleted.

Loading
Loading