Repository navigation
stdlib Http: typed-wasm target (convergence ABI; shared with Ephapax) #225
Copy link
Copy link
Closed
Labels
enhancementNew capability or improvement to existing behaviourNew capability or improvement to existing behaviourmajorMajor issue — significant scope, broader impact than a feature/bugMajor issue — significant scope, broader impact than a feature/bug
Description
Next slice after the Deno-ESM Http primitive (#160). The Deno-ESM target is landed and exercised end-to-end; this issue tracks the typed-wasm target for the same stdlib/Http.affine surface.
Scope
Make Http.fetch/get/post/request work when AffineScript compiles to typed WasmGC (the primary AffineScript target), with identical source-level semantics to the Deno-ESM path.
Why this is convergence-layer work, not AffineScript-internal
The typed-wasm binary conventions are the shared convergence ABI (typed-wasm ADR-004): AffineScript and Ephapax both compile to typed WasmGC and need agreed layout/ABI/host-import conventions. This slice irons the HTTP host-boundary conventions out in the typed-wasm repo, with AffineScript as the first consumer and Ephapax as a co-stakeholder.
- AffineScript is not coupled to typed-wasm by this work, and this does not constrain Ephapax or any future consumer — it only fixes shared conventions where they already converge.
- The HTTP host-import contract (memory layout for strings / assoc-list headers /
Optionbody /Response, plus the async story) belongs in the typed-wasm ABI spec; the AffineScriptlib/codegen.mlchange is the consumer of that contract.
The two real ABI problems (design, not wiring)
- i32-only boundary. The WasmGC backend's host-import path is i32-only —
String/[(String,String)]/Option<String>/ theResponserecord cannot cross directly. Needs a memory-marshalling convention (ptr/len pairs, or a structured-handle table like the Node-CJS shim's), specified in the typed-wasm ABI. - Async over a synchronous import.
fetchis async; wasm imports are synchronous. Needs a suspension design (JS Promise Integration / JSPI, or a host-driven continuation) — shared with Ephapax's async story so both languages agree.
Acceptance
- typed-wasm ABI spec section for the HTTP host boundary (string/assoc/Option/record marshalling + async)
- AffineScript
lib/codegen.mllowershttp_requestto the agreed host import - Node-CJS shim provides the import; e2e parity test mirrors
tests/codegen-deno/http_fetch.* - Ephapax co-stakeholder review of the ABI section
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew capability or improvement to existing behaviourNew capability or improvement to existing behaviourmajorMajor issue — significant scope, broader impact than a feature/bugMajor issue — significant scope, broader impact than a feature/bug
Activity
feat(stdlib): portable Http primitive — Deno-ESM target (Refs #160) (#…
docs(adr): promote Async-on-wasm CPS transform to ADR-013 (#225)
feat(stdlib,wasm): #225 PR1 — typed-wasm Http skeleton + verified The…
feat: #225 typed-wasm Http — ADR-013 + PR1 verified Thenable foundati…
feat(codegen): #225 PR2 — WasmGC CPS transform, Async base case (ADR-013
feat(codegen): #225 PR3a — WasmGC CPS transform, multi-var live-local…
test(borrow): #225 PR3b — affine-capture obligation discharged by com…
feat(codegen): #225 PR3c — WasmGC CPS transform, Async→Async chaining (…
fix(codegen): implement `++` list concatenation (was placeholder I32A…
feat(http): #225 PR3d — typed Response reader (ADR-013 §value-reconst…
docs(http): #225 PR4 — joint-close #160 + #225 (ADR-013 delivery comp…
docs(http): #225 PR4 — joint-close #160 + #225 (ADR-013 delivery comp…
docs(adr): ADR-016 — effect-threaded async-boundary detection (#234 S…
test(codegen): #235 — engine-validate the #199 closure ABI independen…
feat(wasi): #180 ADR-015 S4a — clock_now_ms builtin (preview1 → wasi:…
feat(wasi): #180 ADR-015 S4b — env_count/arg_count + multi-import ind…