Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why wasm32-unknown-unknown? #979

Closed
takkuumi opened this issue Oct 24, 2018 · 3 comments
Closed

why wasm32-unknown-unknown? #979

takkuumi opened this issue Oct 24, 2018 · 3 comments

Comments

@takkuumi
Copy link

takkuumi commented Oct 24, 2018

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?

@chinedufn
Copy link
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
Copy link
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
Copy link
Contributor

Pauan commented Oct 24, 2018

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants