Some of our users have been struggling with figuring out whether or not a particular crate is good to go on wasm32-wasi. Much of that is due to crates that build/link native code, but some of it is also the fact that some of the functions in std
are present but panic when called. I'm wondering just how bad an idea it'd be to omit the functions we don't support, rather than having them fail at runtime, so that these would be compile-time failures instead?
@acfoltzer this is definitely a topic of historical hot debate in rust
it's unfortunately a pretty tricky one though
the short answer is that this wouldn't be easily done, but it's certainly possible
this'd be something to bring up w/ the libs team or on users.r-l.o
most likely
thanks. yeah, I figured there was some story about it. I'm guessing the horse is probably out of the barn but I'll poke around a bit further
I've already poked one hornet's nest with FFI-unwind, not sure I'm up for another one until that's resolved :)
@acfoltzer do you have an idea of what sort of apis folks are most surprised don't work?
like is it all one set of APIs? or is it basically a smattering all over?
I think it's mostly the one in Thread::new()
, where a library spins up a worker thread or something
they're not really encountering it in code they write directly
or something tries to get its threadid
ah ok makes sense
we can probably fix the threadid thing
Thread::new()
is pretty fundamental though :(
(we are still on 1.40.0 for WASI snapshot reasons, so this may be out of date feedback)
yeah definitely. probably don't want to mess with that one till coroutines land
Last updated: Dec 23 2024 at 12:05 UTC