Skip to content

Running a WASI program as a web worker with stdio as messages? #259

@coolreader18

Description

@coolreader18

At first, it seems like it'd be natural to map WASI processes and stdio to the browser with wasmer/wasi and workers and postMessage passing, but I can't seem to get it to work in practice due to the need for fd_read to be synchronous, and the fact web workers can't block (e.g. with while (true) {}) while waiting for a message to be sent, since control can't be yielded to the event loop. Does anybody have any ideas for implementing something like this, or is this basically impossible? (without widespread SharedArrayBuffer support)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions