Stream: general

Topic: Jawsm - a JS to WASM compiler


view this post on Zulip Piotr Sarnacki (Nov 10 2024 at 21:29):

When I was naming the project I knew about JAWS the screen reader, but I didn't think it would lead to any confusion as when you google for JAWS you get mostly pages about Jaws, the movie. A screen reader user mentioned that it's already sometimes hard to find information about JAWS in context of the browser (like javascript developer tools). @benmccann from SvelteKit suggested the name could be Jawsm (pronounced like awesome) and I like that, so I changed the name to avoid any confusion.

view this post on Zulip Christof Petig (Nov 11 2024 at 04:02):

Given the maturity of the current WASI 0.3 prototype by Joel I feel you could take a look at it for any newly starting projects, as async becomes so much easier with 0.3. Feel free to ask questions here, I adapted the code for native compilation and found it easy to understand, given Luke's excellent presentation in Barcelona.

view this post on Zulip Christof Petig (Nov 11 2024 at 04:03):

Also Joel will likely present more about it tomorrow at WasmCon.

view this post on Zulip Piotr Sarnacki (Nov 11 2024 at 13:57):

Thanks for the info @Christof Petig, that's exciting! For now I'm using few functions from WASIp2, mostly subscribe-duration and maybe I'll add outgoing HTTP requests at some point to test things, but a broader WASI integration will come when I get to more builtin types and especially Node.js APIs. Which makes it even better, cause by the time I'm there, I'm guessing WASI 0.3 will be used more widely.

The only potential issue I can see is runtimes support. The code I'm generating is already hard to run almost anywhere without host extensions. For now I added a few simple pollyfill functions to mimic WASIp2 in Node.js/Chromium, but my aim is to be able to run on top of a bare runtime without any custom code. If Wasmtime gets WASI 0.3 support anytime soon, I will definitely give it a shot.

At the moment another blocker for using Wasmtime is the exception handling support, but when I finish await/generators I might just have the tools to rewrite try...catch into WASM code that doesn't need the feature.


Last updated: Nov 22 2024 at 17:03 UTC