-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Support WASIX #17115
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
Comments
I'll be taking a look at this. |
Is it correct to assume that the first step should be to integrate https://github.com/wasix-org/wasix-libc into Working on it here https://github.com/git-bruh/zig |
Yup, that seems like a reasonable approach @git-bruh . |
@git-bruh That sounds like a reasonable approach. |
Question for your last part, wasix can run UDP in the browser? Or is that just worded in a way I am confusing. I thought even with wasm it wasn't possible to use UDP from the browser |
Alright, I've got something working, but it might not be worthwhile progress yet.
wasi_libc.zig solves some of these issues, but it's probably not the only missing piece. |
@rohlem Some of the errors at runtime when using threads/processes are probably an upstream thing, they happen for me even when compiling everything using the official |
@git-bruh Great progress! |
Yeah many parts of the Makefile are broken, like the globs unconditionally include threading-related code even if it's disabled |
Before people put large amounts of effort into implementing this, let's make clear that this is a feature request/proposal which has not (yet?) been accepted by the Zig leadership. As for my personal take, I see WASIX as an effort to port legacy POSIX APIs (including many with questionable design such as fork()) to WASM. This of course makes it technically easier to port existing programs relying on these legacy POSIX APIs to WASM but I worry about how runtimes could possibly implement this API surface securely while maintaining reasonable performance. It frankly seems quite like "containers, but with extra steps" Furthermore, It appears to be driven by a single company which is also responsible for the only implementation. I don't any information on the standardization process and can only assume that it is not open. Without any 3rd party implementations including support in browsers, I think adding support to the Zig standard library would be quite premature. Overall, I do not see how supporting WASIX in upstream Zig aligns with the goals and values of the Zig project. |
@ifreund The way I see it, if WASIX is a functional Zig is of course free to decide not to ship with it, and not to mention it as supported target, nor in the official |
You may have missed this, posting here in case is useful: https://wasix.org/docs/community-and-governance Note: WASIX governance is completely open up for any developer and/or company that wants to contribute or collaborate (including yourself, if you feel that being part of WASIX could be useful for you!) :)
WASIX programs can fully run in the browser (as reflected in the wasix.org homepage).
I hope you will eventually be able to see the long-term value that WASIX could provide to Zig, and hopefully, the work done here by some of the contributors may help to showcase the value of WASIX to the Zig community. Here are a few examples that would be enabled: being able to run Zig compiler anywhere (without restrictions, including Zig+LLVM As previously commented, the reward will be awarded to the developer who fulfills the requirements laid out on the same thread. Keep up the good work! |
Problem statementOverall I think the problem statement (or lack of) is valid: WASI as it stands today is quite weak, there's a lot it can't do, and that is harming WASM adoption overall. I've heard this from my younger brother and others who work professionally using WASM at various CDNs using it for edge functions. It's a real problem, and needs a solution. SolutionsThere are three solutions I see:
Overall I think the situation is 'unfortunate'. It seems unlikely that WASI will improve soon, even more unlikely that WASIX will get any broad adoption by other WASM communities, and it seems unlikely to me 'our own WASI-like specification' would be good long term either (but who knows.) It may be best to just wait. ProposalI expect Zig proposals to follow more of what I wrote above: problem statements, possible solutions. If a company wants to sponsor development of an issue, that's great and reasonable in my view - but the way it was done here was pretty damn poor. I also see your company using it as a marketing opportunity on Twitter and Reddit[0][1] - I'm not against corporate sponsorship of development, and also not against companies or people publicizing they're sponsoring development. Heck, I've done this. But it feels a bit wrong and distasteful given the proposal is to implement your specification, it wasn't even discussed first, and is structured as some sort of bum rush to implement it and get $5k, no? You could have made the proposal, mentioned sponsorship being something you are interested in, see what the community said - and then later on publicize the great work a community member did for you after the fact. That would've felt a lot more like 'company works with community to move software forward' rather than 'company pays bounty in hopes of pushing something through and/or getting a marketing opportunity' I'm not here to call you out for your/Wasmer's iffy behavior as I've done over the years(1) but rather just to let you know this is a really poor way to propose a change to an open source community. |
Just as a quick heads-up from within the twitching corpse: WASI Preview2 has been in the works for a long time, is largely done at this point, and a perfectly reasonable thing to target right now. See this blog post on the Preview 2 roadmap for more details. |
Alright. @kristoff-it and I took a break from working on our other tasks today to address this issue, and in fact we wrote a blog post about it. As a reminder, the Zig issue tracker is not a platform for free speech, for discussing bug bounties, for discussing other people's reputations, or for archiving Internet history. It is only, exclusively, and for no other purpose than for working on the Zig compiler and related tools. Any content that is not doing that will be removed, and any users who I subjectively predict will create more of such content in the future will be blocked. Let us have no more discussion of anything in this topic other than WASIX and its technical merits, or lackthereof. |
Random internet person here. Personally, I would love if Zig (or some additional C compatible languages like Nim or V) supported WASI/WASIX directly. As primarily a Python dev, I know of an entire dev community that would benefit from having an accessible low level language like Zig with WASI implementations. But I also get the points made about WASM/WASI standards vs how WASIX comes across. Regardless of how the bounty stuff came across, I hope y'all implement it. WASI would be a great pivot for me to use Zig. 🙏🏿 |
@daddycocoaman Unless I'm mistaken, there is (some?) support already for WASI |
@daddycocoaman |
Sorry, maybe I wasn't specific enough. I know WASI is a target but I kinda assumed that the inclusion of WASIX here would also imply that Zig would gain a first-class runtime library as well (likely Wasmer in this case but any runtime, really). Unless I missed that one somehow. 👀 |
I'd like to work on this :) |
The Consortium For Advanced Super-Friends wants full sockets and multithreading in wasm |
One benefit, which may be useful for Zig, of WASIX is that it does not require Rust code within the compilation process. Contrasted with WASI 0.2, which requires a compiler in Rust to 1. generate component type objects and 2. create and assemble the component. Until Zig can support the component model format, WASIX may be an attractive option for use cases involving sockets and external command execution (though that is not the best way of composing programs, nor is WASIX extensible to non-POSIX apis). |
Uh oh!
There was an error while loading. Please reload this page.
Zig currently doesn't support Wasm/WASIX applications.
WASIX is a new standard emerging (as a non-breaking addition) over WASI Preview 1. WASIX adds full support for things like: pthreads, sockets, fork, process spawning and many more things.
See more detailed blogpost for the announcement here: https://wasmer.io/posts/announcing-wasix
And WASIX website: https://wasix.org/
Expected Behavior
Zig supporting WASIX would be huge for the Wasm and Zig communities.
Why?
The text was updated successfully, but these errors were encountered: