-
Notifications
You must be signed in to change notification settings - Fork 37
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
possible to target wasm32-wasi? #57
Comments
I'm not familiar with the capabilities/restrictions of WASM + WASI - are |
Fat fingered "close", sorry |
Oh I don't know either and research is a little confusing. Please let me share my findings with you:
Maybe it helps to show you the compiling errors:
Furthermore, I noticed those lines here:
Maybe it's possible to import them only for specific build targets? Please let me hear your opinion :). |
This crate is very much so only intended to target Linux and wasm/wasi is not that. I think a more interesting approach in general would for there to be some project which seeks to provide an implementation of the https://github.com/rust-embedded/embedded-hal traits that could execute within an environment like wasm32-wasi which would proxy requests through some mechanism to an implementation in the host environment. At least, that's my intuition while not having extensive experience with wasm. This would seem to be much more well suited to implementing things portably and securely across platforms which is one of the reasons that people often are deciding to target wasm. |
That's a fair point. We'd be mixing separations there. Trying to bring it on wasm without an official API also feels kinda hacky. The complexity comes from the goal to portability across platforms. We're at a dead end here, I guess :/ |
I agree with @posborne. This is a very system-specific crate to target a Linux subsystem. It is not intended to be portable across platforms. If a generic GPIO library exists, that would be a proper choice for something like this. |
I think it would be amazing to be able to compile to WASM + WASI, so that we can compile code, that has only access to given devices. In my understanding, it should be possible, since /dev/gpiochipX are handled as files** and could be preopened via fs over WASI. I'm a total noob though, so I don't know if that's even possible.
Following, some interesing infos I've found:
wasm3
runtime that use WASI with Arduinos by passing the needed functions into WASM.Currently building to target
wasm32-wasi
results in several errors.** on Linux
The text was updated successfully, but these errors were encountered: