feat(bindings): close bindings roadmap #5 — AS-side wasmCall surface#431
Merged
Conversation
Host-side codegen for wasmCall landed via #422 (`__as_wasmCall` helper + lowering-table entry in `lib/codegen_deno.ml`), but the AS-side surface (`pub extern fn wasmCall` in `stdlib/Deno.affine`) and test fixtures that PR #419 originally bundled were lost when #419 was closed as "superseded by #422". This re-lands the AS-side bits so the binding is end-to-end usable, flipping roadmap row #5 from `◐ host-side; AS-side ○` to `● usable (Option A landed)`. Surface: pub extern fn wasmCall( exports: WasmExports, name: String, args: [Float] ) -> Float; Lowers to `Number(exports[name](...(args || [])))` on `--deno-esm`. Number coercion means i32/i64/f32/f64 export return types all flow back as `Float` at the AS boundary. Caller is responsible for the export existing + arity-matching; absent exports raise the host `TypeError` at the boundary (documented in the extern docstring). Files: - `stdlib/Deno.affine` — new `wasmCall` extern + docstring with `Bytes -> WasmExports -> wasmCall` worked example. - `tests/codegen-deno/wasm_call.affine` — fixture exposing `addViaWasm`. - `tests/codegen-deno/wasm_call.harness.mjs` — Node ESM harness instantiating a hand-built 41-byte wasm module exporting `add(i32, i32) -> i32`; asserts 4 round-trip cases. - `docs/bindings-roadmap.adoc` — row #5 status `◐` → `●` and the cross-cutting observation reads "LANDED" instead of "one-day fix". Local verification: - `affinescript check stdlib/Deno.affine` → "Type checking passed". - `affinescript check tests/codegen-deno/wasm_call.affine` → "Type checking passed". Closes bindings roadmap #5. Closes #414 (host-side via #422, AS-side via this PR). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 81 issues detected
View findings[
{
"reason": "Action actions/checkout@v6 needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action denoland/setup-deno@v2 needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in affine-vscode-publish.yml",
"type": "unknown",
"file": "affine-vscode-publish.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "unknown",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "unknown",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "unknown",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "unknown",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "unknown",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "unknown",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "unknown",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Re-lands the AS-side
wasmCallsurface (extern + test fixtures + roadmap row flip) that PR #419 originally bundled. #419 was closed as "superseded by #422", but #422 only carried the motion binding — the host-side codegen (__as_wasmCall+ lowering-table entry) is present onmainwhile the AS-side pieces are missing.Flips
docs/bindings-roadmap.adocrow #5 from◐ host-side; AS-side ○to● usable (Option A landed).stdlib/Deno.affine: newpub extern fn wasmCall(exports: WasmExports, name: String, args: [Float]) -> Floatwith docstring +wasmInstance → wasmCallworked example.tests/codegen-deno/wasm_call.{affine,harness.mjs}: round-trip harness over a 41-byte inline wasm module exportingadd(i32, i32) -> i32(4 assertions).docs/bindings-roadmap.adoc: row ci: Bump actions/github-script from 7.0.1 to 8.0.0 #5 status◐→●; cross-cutting §2 observation rewritten "LANDED".Closes bindings roadmap #5. Closes #414 (host-side via #422, AS-side via this PR).
Test plan
affinescript check stdlib/Deno.affine→ Type checking passed.affinescript check tests/codegen-deno/wasm_call.affine→ Type checking passed.tools/run_codegen_deno_tests.sh(gated on Actions budget — admin-merge per estate policy).Out of GH Actions budget; admin-merging on clean local verify per estate policy (see MEMORY.md
session-2026-05-27-estate-sweep-1254-prs).🤖 Generated with Claude Code