@Alex Crichton question about wasm-tools/41: would no-std-compat help with this, by any chance?
it might but it depends on the goal
if we were to commit to no_std suport then something like that probably makes sense
but I still feel somewhat strongly that we should not at all commit to no_std because I don't understand why we should
one reason would be that there's increasing interest in Wasm in embedded environments. I think I understand the issues well enough to see why just no_std support doesn't really solve much, but if we could support it without bending over backwards in the implementation code of affected crates themselves, then it might be tenable?
my, potentially wrong, understanding of no-std-compat is that it would allow us to do just that, no?
yes I don't want to block anything arbitrarily, and I understand that embedded folks are interested in no_std, but I really really don't want to just blindly follow where everyone else wants us to go
I think we're on the same page, but no one has yet to present me (in my opinion at least) a compelling reason to support no_std
like no one has a target where wasm/wasmtime actually make sense on the target, and the target has a really good reason to not support std
it's also worth pointing out that no-std-compat
is a giant wad of code we would need to very carefully audit, and AFAIK no one's done that
naturally we're not just gonna blindly use it because it sounds nice, and right off the bat the usage of spin
is inappropriate for us
Alex Crichton said:
like no one has a target where wasm/wasmtime actually make sense on the target, and the target has a really good reason to not support std
yeah, I agree that we should only support no_std if there really is a compelling argument for it. Not sure if Tomaka's use case for Redshirt qualifies, but at least they think it does, AIUI
Alex Crichton said:
it's also worth pointing out that
no-std-compat
is a giant wad of code we would need to very carefully audit, and AFAIK no one's done that
good point!
Of course yeah I don't want to rule anything out, but I don't want us to get into the mindset of "oh if we #![no_std]
everything we run everywhere!"
that's a fallacy which will lead us to writing a bunch of spaghetti code
like does tomakas platform actually support mmap
? and writable pages? (etc)
makes sense, yes
basically what I'm saying is that supporting every target under the sun requires more careful planning than "let's blindly #![no_std]
everything and play whack-a-mole until everything compiles"
we shouldn't do it just for doing it, but of course actually supporting these targets is fine
AFAIK we just don't have a story to actually support any of these targets other than "we wish we could"
like if tomaka's platform only supports interpreters then that's probably a better thing to design first than slapping #![no_std]
everywhere
I also want to push back really hard on that if you have a libc
(or some OS equivalent) then your platform really should support std
and I'm more than happy to do any work upstream necessary to make that a reality
std
is core
+ libc
, and that's basically it
and if your platform really truly only has core
then you're like a microcontroller with 8k of rame
Alex Crichton said:
and if your platform really truly only has
core
then you're like a microcontroller with 8k of rame
heh, fair
to be clear, we definitely shouldn't do the work of creating this support, or even the story for supporting more esoteric platforms. What I do think would be good is to have documentation of our position on this that people can read to understand what they'd need to do to upstream changes supporting their platform
for sure yeah, and if needed I'd be happy to write up at least my own personal point of view
I think that'd be great! Perhaps as part of the book, with a direct link from the main README.md?
Last updated: Dec 23 2024 at 13:07 UTC