What approach are you using? Been working on a similar in-browser node runtime based on Rust/WASM kernel + Service-Worker HTTP intercept + CJS→ESM transform.
Feature wise, does this compare to StackBlitz webcontainers?
Then, the second part which was really important to me, was figuring out if I could find a way to embed the developer's JS code within the worker without requiring them to install Cargo. (thanks to Wizer it's possible, love it).
Once I had those two, the rest was basically execution (not saying it was straightforward though ;)
I was also a bit lucky: at the same time as I was developing it, Rolldown announced the version 1 of their standalone crate. So it was the perfect timing to use it as well.
As for StackBlitz WebContainers, I actually don't know much about it. They run in the browser as I understand, so fundamentally different but, feature wise I'm sure this project is way more mature and therefore offers way more features.
> They run in the browser as I understand, so fundamentally different
Yes, runs entirely in the browser, while this is a hosted product. StackBlitz technology is really good but it is closed source.
Your setup - Rust/WASM kernel + Service worker - sounds really sweet. If already public, please do share the link, else looking forward to your launch!
Even though our product was not a commercial success ~3 yrs ago I still believe something like this should succeed and give people choice when it comes to isolation/virtualization (containers, microVMs, Wasm). They are each useful and appropriate for different things.
If someone feels like an eli5 - What are the use-cases for something like this?
So, with a sandbox library like this, you could - say - write a website that hosts games (like itch.io or newgrounds) that hosts games on the world wide web. The sandbox part can give you confidence that, if a villain's programmer henchmen uploads a virus instead of a game, it can't infect your platform or other games on the website. Or, if a LLM-AI written game is accidentally tries to take up all the memory of the computer, it can't ask the operating system for more than is in the sandbox.
Others mentioned better use cases than I could probably come with. Not sure it's a strong use case but, one thing I could maybe mention too is the fact that it ships as a standalone artifact. It's portable and, if reproducible, can provide some sort of guarantee on what's effectively running for those who care.
JavaScript alone can't handle that kind of heavy lifting efficiently. That’s where Wasm comes in. It lets you run high-performance native code (like C++) at near-native speed safely in the sandbox.
For example, I'm currently using Wasm to run a complex 3D geometry engine (Manifold) inside a lightweight CAD app (Nasscad). It gives you web flexibility with desktop power.
This tool seems useful for running 0 dependency JavaScript with isolation through web assembly as an alternative to the isolation and ease of use provided by tools such as cloudflare workers.
True... but also WebGL/WebGPU on Vulkan/Metal/etc is a thing. You can run shaders on your GPU via the Web already.
You can definitely run workerd in production on your own machines and some people do.
The biggest catch is that workerd's implementation of Durable Objects currently doesn't work across multiple machines, but I'm working on fixing that: https://github.com/cloudflare/workerd/pull/6780