Skip to content
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

wasm: support new WASI interface #31105

Open
johanbrandhorst opened this issue Mar 28, 2019 · 20 comments
Open

wasm: support new WASI interface #31105

johanbrandhorst opened this issue Mar 28, 2019 · 20 comments

Comments

@johanbrandhorst
Copy link
Member

@johanbrandhorst johanbrandhorst commented Mar 28, 2019

Mozilla, Fastly and others have started work on a new standard interface for WASM to interact with system calls, they're calling it WASI, the WebAssembly System Interface.

https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

I think we should consider supporting this in the Go WASM architecture, possibly under a new OS (GOOS=WASI).

This issue should track the development of such an effort.

Mozilla have invited interested parties to join the #wasi channel on the Mozilla IRC server (https://wiki.mozilla.org/IRC).

@johanbrandhorst
Copy link
Member Author

@johanbrandhorst johanbrandhorst commented Mar 28, 2019

@neelance
Copy link
Member

@neelance neelance commented Mar 28, 2019

I'm already looking into this. Yes, this is likely to become the GOOS/GOARCH wasi/wasm. My current long term plan is to also make js/wasm partially use WASI as soon as a feature can be expressed with WASI without losing any functionality.

@johanbrandhorst
Copy link
Member Author

@johanbrandhorst johanbrandhorst commented Mar 28, 2019

https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md this looks like a good list to reference.

@neelance
Copy link
Member

@neelance neelance commented Mar 29, 2019

My WIP for WASI can be found here: https://github.com/neelance/go/tree/wasi

There is no GOOS=wasi yet, use GOARCH=wasm + GOOS=js to target WASI. The fork is thus not compatible with wasm_exec.

@ghost
Copy link

@ghost ghost commented Jul 2, 2019

This is a very important thing.
Wasi can be a new containerisation approach but running on mobiles, desktops, IOT and servers. It solves is able to solve a fundamental problem of trusting code from someone else with the host deciding what file / network IO the third party code has access to.
Sort of like how android will prompt you when an app wants to access your contacts or file system.

Wasmer git repo has it working for golang, python using a rust wasm / wasi engine currently btw. It's fast too.
https://github.com/wasmerio/go-ext-wasm

It seems that there is not IDL / RPC standard yet for WASI though. I looked but could not find. If anyone knows would be great.

@tiborvass
Copy link

@tiborvass tiborvass commented Jul 3, 2019

@gedw99 you should probably ask on the WASI repo instead. Not sure if WebAssembly/WASI#49 is what you're looking for. Either way WASI is still in active development so it is normal that certain things are lacking.

@philippgille
Copy link

@philippgille philippgille commented Jan 14, 2020

It's great to see there's some interest here! How is the progress? I see a recent commit from Dec 26, 2019 and one before that on Mar 29, 2019 in the fork of @neelance.

I recently stumbled on https://webassembly.sh, which drops you into a shell where you can execute WebAssembly binaries that were packaged with the WebAssembly Package Manager (wapm, by the Wasmer guys) and target WASI: https://wapm.io/interface/wasi

There are small command line programs like cowsay and lolcat, but some people seem to try to experiment with bigger things as well (TiDB, but didn't try it out).

So naturally, I'd like to experiment with this new tech and create a WASI-targeting WASM file with Go, upload it to wapm and try it out on webassembly.sh :)

@neelance
Copy link
Member

@neelance neelance commented Mar 8, 2020

@philippgille I've updated my fork and just successfully ran a Go program on webassembly.sh. Try hello-go.

@superloach
Copy link

@superloach superloach commented Mar 9, 2020

@neelance can we get a status update on WASI support? What's still missing? Do you need help with anything?

Very excited to get this working - combining the portability of WASI with the strength of Go will open up lots of opportunities. 😃

@carlskii
Copy link

@carlskii carlskii commented Jun 3, 2020

Any update on this?

@mvdan
Copy link
Member

@mvdan mvdan commented Jun 3, 2020

A reminder that this is open source and there are no ETAs, especially when it comes to external contributions such as Richard's. He hasn't posted any update in this thread since March, so that's the latest update. If you want to be notified of updates, subscribe to the thread. Aside from that, the best way to speed up progress is to check out his work, figure out how it works, and try to improve it.

@inliquid
Copy link

@inliquid inliquid commented Jun 3, 2020

Open source doesn't mean there is no ETA.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 3, 2020

@inliquid That is true but I hope that the meaning is reasonably clear. Please be charitable in your understanding of what other people write. Thanks.

@neelance
Copy link
Member

@neelance neelance commented Jun 3, 2020

See #38248 for what I was working on. No ETA though. Depends on how much time I get to spend on contributing to the Go project.

@inliquid
Copy link

@inliquid inliquid commented Jun 3, 2020

That is true but I hope that the meaning is reasonably clear. Please be charitable in your understanding of what other people write. Thanks.

Meaning is clear and it's not correct. At least in a form when someone replies to very reasonable question "this is open source". Open source doesn't mean work is not paid or not compensated in other ways. In most cases it's just one of the business models. So no one should feel like asking for ETA or just a progress is something wrong.

@icholy
Copy link

@icholy icholy commented Jun 10, 2020

@inliquid the ETA is whenever @neelance feels like it.

@neelance
Copy link
Member

@neelance neelance commented Jun 10, 2020

Open source doesn't mean work is not paid or not compensated in other ways.

@inliquid Just to be clear: I am not getting compensated for my work on WebAssembly/WASI in any way. I am not even using it at my day job. I just work on it because I believe it should exist.

@icholy The phrasing of your comment is ambiguous, at least to me.

@icholy
Copy link

@icholy icholy commented Jun 10, 2020

@neelance sorry, I meant that you have no obligation to provide a timeline for your free (and awesome) work.

@inliquid

This comment was marked as off-topic.

@mvdan
Copy link
Member

@mvdan mvdan commented Jun 11, 2020

Let's please remain on topic. Yes, we all wish Go had more features and less bugs. There are literally thousands of issues open, and priorities are different depending on who is asked.

I'll hide the last comment and any future ones that just continue on the topic of ETAs, so the thread can just go back to development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.