Skip to content

New ABI: "wasm" #90

Closed
Closed
@alexcrichton

Description

@alexcrichton

Summary

I was recommended by @joshtriplett to open a proposal for design meeting about the new extern "wasm" ABI that I prototyped in rust-lang/rust#83763. This, if stabilized, would add a new ABI to Rust which is specifically for WebAssembly targets to facilitate authors in Rust to target precise WebAssembly signatures if they're either importing or exporting a function of that precise signature.

Background reading

There's quite a lot of possible background reading for this, but the details are generally relatively light with how they correspond to Rust. The motivation for this is a bit thorny, however. In order of increasing level of detail, some possible reading is:

About this issue

The addition of a new "wasm" ABI is intended to solve a longstanding issue in Rust where the wasm32-unknown-unknown target's ABI does not match Clang, making interoperability of C and Rust code more difficult there. In addition to fixing this issue, though a long-lived "wasm" ABI is intended to provide the ability for authors in Rust to target specific WebAssembly signatures. When compiling to WebAssembly the function signature that comes out the other side is generally intuitive but can be a bit of a black-box in some regards. By providing a "wasm" ABI we give room for Rust to have its own definition of how Rust code will map onto generated WebAssembly code. (it's then up to rustc to figure out how to tell LLVM how to do that).

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langmeeting-proposalProposal for a lang team design meetingmeeting-scheduledLang team design meeting that has a scheduled date

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions