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

uwasi instread of browser_wasi_shim #482

Open
tani opened this issue Jun 29, 2024 · 3 comments
Open

uwasi instread of browser_wasi_shim #482

tani opened this issue Jun 29, 2024 · 3 comments

Comments

@tani
Copy link
Contributor

tani commented Jun 29, 2024

The current Ruby.Wasm is written with separate implementations for Node and Browser.
I can see considerable ingenuity and hard work. Thank you for all the work you have done. Now, I have found a way to solve this difficulty.
The swiftwasm team is developing uwasi, which seems to cover both Node and Browser implementations.
Asciidoctor-wasm implements DefaultRubyVM using this uwasi.

https://github.com/tani/asciidoctor-wasm/blob/f7a240f03c4d33d1235f68cda2497bda874988a0/src/asciidoctor.ts#L1-L21

If this implementation is adopted so that there is no need to separate the Browser and Node implementations, users will not have to distinguish between the Import of the Node and Browser implementations when using Ruby.wasm, which would be a great improvement. Please consider this.

Cheers

@tani
Copy link
Contributor Author

tani commented Jun 29, 2024

Oh, it is your work. You can close this issue.
Would you mind askingwhy you do not use this ?

@kateinoigakukun
Copy link
Member

kateinoigakukun commented Jun 29, 2024

Despite its name, @bjorn3/browser_wasi_shim also works on Node.js as long as you don't need to access host file system (it only works for in-memory fs). So if you don't care much about code size and underlying file system, you can use @bjorn3/browser_wasi_shim instead of uwasi.

Having said that, @ruby/wasm-wasi package itself cannot assume people don't care about the file system access on Node.js, so we use Node's wasi implementation as a less-restrictive option by default .

@kateinoigakukun
Copy link
Member

Would you mind askingwhy you do not use this ?

uwasi doesn't have file system implementation yet (and I don't have enough time working on that 😓), and @bjorn3/browser_wasi_shim had several contributors, so I decided to put my effort into fixing it instead of growing uwasi up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants