Draft Networking
WalkLang networking is draft-only. It is implemented for native CLI experiments, not as part of the stable feature set.
Scope
The current draft http module includes:
imp: http
var: response = http.get('http://127.0.0.1:8080/health')
out: response.ok
out: response.status
out: response.body
out: response.error
http.get(url) -> HttpResult
http.post(url, body) -> HttpResult
http.request(method, url, body) -> HttpResult
HttpResult is:
struct: HttpResult
ok bool
status int
body string
error string
Runtime Backend
The C backend keeps release builds portable by delegating draft HTTP requests to the system curl executable at runtime. WalkLang does not link libcurl or ship a TLS stack in generated C yet.
This is a deliberate draft dependency decision:
- release cross-builds still need only Go and the target C toolchain
- native HTTP programs need
curlavailable onPATHat runtime - TLS behavior is owned by the host
curlbuild and host certificate store - missing
curl, network failures, DNS failures, TLS failures, and timeout
failures return HttpResult data instead of runtime-stopping
Security Policy
Draft HTTP uses argv-style process execution. It does not invoke a shell.
Default policy:
- redirects are followed
- timeout is 10 seconds
- response bodies are capped at 1 MiB by the runtime request command
- response bodies are UTF-8 text only
- status codes
200through399setok true - other status codes set
ok false, preservebody, and set - empty method or URL returns a recoverable error before any process spawn
error 'http status'
Not included yet:
- custom headers
- cookies or a cookie jar
- authentication helpers
- streaming responses
- binary bodies
- server APIs
- async/event-loop APIs
Testing Policy
Network tests must not depend on public network availability. Compiler/runtime tests use local loopback HTTP servers and skip only when the draft runtime backend dependency, curl, is unavailable. The systems compiler runtime-module conformance fixture also covers deterministic HTTP failure result data for empty method and empty URL inputs through the active C++/C walk compiler.