Skip to content

Add a standalone WebAssembly host interoperability example #661

Closed

Description

@LunaStev

Why

examples/wasm_module.wave exercises many WebAssembly backend features at once and is used by CI smoke tests. It includes extern(c) and export(c) host boundaries, but there is no small self-contained example showing how a JavaScript host actually provides and calls those functions.

Scope

Add a small WebAssembly interoperability example under examples/ with a Wave module and a minimal JavaScript host, preferably using Node.js and no third-party packages.

The example should demonstrate:

  • importing one host function through extern(c, "...");
  • exporting one Wave function through export(c, "...");
  • instantiating the generated .wasm file from JavaScript;
  • providing the required env import object;
  • calling the Wave export and checking a deterministic result.

Keep this separate from the existing WebAssembly smoke module rather than expanding that file further. Missing-host-import diagnostics remain tracked separately by #453.

Completion criteria

  • The Wave source passes wavec check and builds for wasm32-unknown-unknown.
  • The JavaScript host runs with the Node.js version already used by CI and requires no npm dependencies.
  • The host supplies the imported function and successfully calls the exported Wave function.
  • A short README or examples index entry includes the exact build and run commands.
  • Existing wasm_module.wave, wasm_run.wave, and WASI smoke coverage remain unchanged.

Activity

  1. added
    documentation
    good first issue
    needs testing
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions