Skip to content

Drop 64-bit types from the signatures #334

Closed
@zeux

Description

@zeux

I will not be surprised the ship has sailed on this one, but I'd like to file this issue regardless.

As it stands today, WASI is incompatible with Wasm MVP because multiple functions use 64-bit types in function signatures without using pointers to wrap them. This is true of path_open, fd_seek and possibly some others.

This is problematic because Wasm MVP doesn't define a mapping between int64 and any JS types, which means that it's impossible to load a WASI Wasm binary into a browser.

This issue can be worked around, either by a i64 lowering pass, or by dropping these specific WASI calls and replacing it with other calls, making the Wasm binary non-WASI compliant. None of these are good options - lowering requires a heavy transformer framework with JS-side Wasm parsers, and working around the ABI makes Wasm binaries application-specific.

Now, in theory this problem is solved by BigInt <-> i64 mapping, but in practice this is not enabled by default in Node.js (requires an experimental command-line flag!), and doesn't seem to be available in Safari based on https://www.chromestatus.com/feature/5648655109324800.

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