-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
no_std support for my OS #3451
Comments
Cranelift could get no_std support, but wasmtime can't as it depends on the OS for example for mapping memory with the right priveleges. |
Our docs contain a fairly long explanation of our current stance on |
@bjorn3 They could easily just use a trait for host operations. Then they could define operations for when libstd is included and just use that, and when your in @tschneidereit I don't consider the majority of arguments against
I know that getting Thoughts about all of this? (This was a pretty long reply, sorry!) |
Update: yes, the first answer is a bit useful, but as noted in the issue, it doesn't yet support JSON targets, and that's what I'm using. |
This has a non-trivial cost. I would love fixing the no_std support of Cranelift as it doesn't depend on an OS at all and shouldn't do so no matter what. For Wasmtime it is too much tied to the OS, with everything from mmap, files, locks, stack unwinding, ... It also has a lot of dependencies that don't support no_std which you will have to convince to add no_std support too. For most of them using traits will likely not be accepted at all due to being bad for api usability on platforms that support std. |
@bjorn3 Oh okay, I understand now. I'm just trying to find a high performance interpreter with a (reasonably) good API that supports |
@ethindp I'll echo what others have said about the effort involved in porting Wasmtime due to its OS-specific use of memory mapping (mainly) facilities and all of the dependencies it pulls in that are also Maybe a starting point for that could be to use the data structures that one of the "super-simple" interpreters has defined -- wasmi perhaps -- and then start to generate function bodies with Cranelift that use the same data structures. Anyway, just a thought; best of luck with your project! |
I realize it's been years since this was originally opened, but in case anyone cc'd on this issue is still interested I've opened #8341 with a proposal to add no_std support for wasmtime which would address this issue as-stated. |
This is done now with documentation here to be released with Wasmtime 21, so closing. |
I'm working on a hobby operating system and want to develop my drivers in something other than native code. I'd really like to go for web assembly but there are no good web assembly runtimes for no_std, and the only one I know of -- Wasmi -- appears very confusing to use and to work with. This is (possibly another) use-case for no_std support. Can this be done right now or do I have to try to figure out wasmi? (I'm not aware of any other Wasm runtimes, but if there's one I just don't know about, well...).
The text was updated successfully, but these errors were encountered: