slovo/.llm/BETA_6_NETWORKING_FOUNDATION.md

67 lines
2.8 KiB
Markdown

# 1.0.0-beta.6 Networking Foundation Target
Status: released as `1.0.0-beta.6` on 2026-05-22.
`1.0.0-beta.6` targets a deliberately narrow networking foundation after the
resource-handle and host-error policy introduced in `1.0.0-beta.2`. The goal
is blocking loopback TCP only, enough for local client/server fixtures and
small request/response examples without committing to a full networking stack.
## Slovo Source Surface
The staged source facade is `lib/std/net.slo`, importable explicitly as
`std.net`.
Exported helpers:
- `tcp_connect_loopback_result : (i32) -> (result i32 i32)`
- `tcp_listen_loopback_result : (i32) -> (result i32 i32)`
- `tcp_bound_port_result : (i32) -> (result i32 i32)`
- `tcp_accept_result : (i32) -> (result i32 i32)`
- `tcp_read_all_result : (i32) -> (result string i32)`
- `tcp_write_text_result : (i32, string) -> (result i32 i32)`
- `tcp_close_result : (i32) -> (result i32 i32)`
- `tcp_write_text_ok : (i32, string) -> bool`
- `tcp_close_ok : (i32) -> bool`
The `i32` values returned by successful connect/listen/accept operations are
opaque process-local handles. They are not host file descriptors, stable ABI
values, transferable capabilities, or ownership-checked affine resources.
## Runtime Calls
The facade wraps these compiler-known runtime calls:
- `std.net.tcp_connect_loopback_result(port i32) -> (result i32 i32)`
- `std.net.tcp_listen_loopback_result(port i32) -> (result i32 i32)`
- `std.net.tcp_bound_port_result(handle i32) -> (result i32 i32)`
- `std.net.tcp_accept_result(listener i32) -> (result i32 i32)`
- `std.net.tcp_read_all_result(handle i32) -> (result string i32)`
- `std.net.tcp_write_text_result(handle i32, text string) -> (result i32 i32)`
- `std.net.tcp_close_result(handle i32) -> (result i32 i32)`
Ordinary host failures return `err 1`. Successful status-returning operations
return `ok 0`. Successful handle-returning operations return `ok handle`.
Successful `tcp_bound_port_result` returns the bound loopback TCP port.
## Fixtures
- `examples/projects/std-import-net/` exercises explicit `std.net` source
import.
- `examples/projects/std-layout-local-net/` mirrors the facade as a local
module fixture and keeps the source-search contract explicit.
The source-side fixtures use invalid ports and handles for deterministic
result-shape checks. Positive loopback client/server behavior is covered by
the matching compiler/runtime tests when the local sandbox allows loopback
sockets.
## Deferrals
This scope does not add DNS, TLS, UDP, Unix-domain sockets, non-loopback
binding, async IO, event loops, readiness polling, timeouts, buffering policy,
HTTP frameworks, socket options beyond the implementation minimum,
platform-specific error codes, rich host-error ADTs, stable runtime helper
symbols, stable ABI/layout/ownership guarantees, automatic cleanup, or a
stable standard-library API freeze.