WebAssembly / WebAssembly/WASI

How to represent callbacks in WASI?

Open
#669 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

I'm looking to create a Signal engine like how SolidJS works, with a WASI interface. The way Solid handles dependency tracking is the provided callback is called once during declaration and the getters add the callback as a dependency of their signals, using a global variable to store the callback for the getters to reference. To implement this kind of functionality, I need to implement callbacks. In other words, the engine will provide a createEffect() function that a wasm component will use by passing in the callback to invoke whenever the signals update. Since WASI doesn't seem to support functions as parameters directly, what's the best way to do this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is identified. Start by reading the WASI interface documentation and the WebAssembly function-parameter model, then compare them with the callback and dependency-tracking requirements described here. Done means a maintainer-approved design for representing and invoking callbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
api, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.