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 /
Option body / Response, plus the async story) belongs in the typed-wasm ABI spec; the AffineScript lib/codegen.ml change 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> / the Response record 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.
fetch is 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
Refs #160. Companion: typed-wasm ADR-004.
Next slice after the Deno-ESM
Httpprimitive (#160). The Deno-ESM target is landed and exercised end-to-end; this issue tracks the typed-wasm target for the samestdlib/Http.affinesurface.Scope
Make
Http.fetch/get/post/requestwork 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.
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)
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.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
lib/codegen.mllowershttp_requestto the agreed host importtests/codegen-deno/http_fetch.*Refs #160. Companion: typed-wasm ADR-004.