Skip to content

why wasm32-unknown-unknown? #979

Closed
Closed
@takkuumi

Description

@takkuumi

there is no a better name?
why wasm32-unknown-unknown? there is a wasm32-known-known?
why wasm32? there is a wasm64 or wasm 128?

i think we need new name, like rust-wasm?

Activity

chinedufn

chinedufn commented on Oct 24, 2018

@chinedufn
Contributor

My understanding is that the first unknown is the system that you are compiling on, and the second is the system you are targeting.

So you an think of unknown-unknown as

โ€œCompile on almost any machine, run on almost any machineโ€

If you look at other targets โ€œunknownโ€ is commonly used so this is in line with the other targets.

Hope that helps!!

alexcrichton

alexcrichton commented on Oct 24, 2018

@alexcrichton
Contributor

Indeed @chinedufn is spot on here! The wasm32 means that the address space is 32-bits large, and eventually we'll have wasm64 which means the address space will be 64-bits large (but no one implements this yet).

In theory this target name is largely hidden from you when using wasm-pack as well!

Pauan

Pauan commented on Oct 25, 2018

@Pauan
Contributor

@NateLing To expand on what others have already said: yes there will eventually be a wasm64-unknown-unknown, and there were discussions about adding in things like wasm32-unknown-node, wasm32-unknown-web, etc. (though it's unlikely they'll be added in)

The wasm32-unknown-unknown name is consistent with Rust's existing names for compilation targets. Since Rust supports so many different targets, it's important to have consistent names.

If your concern is with the annoyance of typing out wasm32-unknown-unknown, you can use wasm-pack, or you can configure Cargo to use wasm32-unknown-unknown by default:

[build]
target = "wasm32-unknown-unknown"
zzz6519003

zzz6519003 commented on Aug 22, 2024

@zzz6519003

+1 too confusing, should be self-explanatary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @alexcrichton@Pauan@zzz6519003@chinedufn@takkuumi

      Issue actions

        why wasm32-unknown-unknown? ยท Issue #979 ยท rustwasm/wasm-bindgen