Skip to content

Rust Wasm ABI is unstable and will be changed eventually #661

@Manishearth

Description

@Manishearth

Previously: #657 (talking about the specific issue we found)

As explained in rust-lang/rust#129486, the Rust Wasm ABI is currently not following tool conventions and is unstable. rust-lang/rust#117919 details the plan to move forward from here, with a -Zwasm-c-abi=spec flag that will become default over time.

This ABI is one where all non-scalar structs are passed as pointers, which means that JS will have to preallocate all structs (except those that wrap a single scalar) and pass them in as pointers. More expensive, but fine.

On the plus side, we can get rid of a lot of the finicky code from #660.

We don't have to do this now, but we should before Rust changes defaults. When we do we should document it. We can potentially support both forms if people really ask for it, but it could get pretty gnarly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-jsJS backend

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions