Wasm32-unknown-unknown VS wasm32-unknown-emscripten - in 2024?

Hi,

I know this topic already came up a lot in the past, but I wonder what the current (2024) state of the affair mentioned in the title is.

Both targets enjoy the same level of support (Tier 2 without host tools), so I assume the emscripten target is not obsolete, like some people claim in older threads?

Is there any difference in speed or stability?

I've been experimenting around with both targets and found it helpful that the wasm32-unknown-emscripten target has more straightforward support for dlopen() style dynamic loading of modules (in fact, I could get rust-libloading to work), and also pthread (which I haven't tried yet).

So ultimately I'm a bit lost on the issue, and wonder if someone could give me some clarity ...

Best,
n

I cannot comment on how practical it actually is to use wasm32-unknown-emscripten, as I have not done so myself, but the main disadvantage I am aware of is that today, most Rust libraries that support web platform features only support wasm-bindgen-based access to them, which is incompatible with using Emscripten. That is the main way in which it is “obsolete”.

But this is not a problem for using libraries which don't care about the target (i.e. do some sort of pure computation and not IO).

Ah, yes, that makes sense. So it's a tradeoff, either have easy access to certain functions or the convenience of wasm-bindgen ...

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.