Live data from Hacker News

Container2wasm: Convert Containers to WASM Blobs

github.com

51–60 of 72 posts

Re: Container2wasm: Convert Containers to WASM Blobs

#52
post #31
post #23

Earlier quoted context omitted.

I very much doubt it's "any" docker image. WASM isn't 1:1 feature equivalent with docker. e.g. filesystem access

It looks to me like they solve that by simulating the entire Linux operating system, filesystem included. You won't get persistence when you restart the process, but you'll still be able to run code that needs to read and write files. Try it for yourself: visit https://ktock.github.io/container2wasm-demo/amd64-debian-was... to start a shell against a Debian container, then use "echo 'hi' > hello.txt" to write a file…

> You won't get persistence when you restart the process, but you'll still be able to run code that needs to read and write files.

Since it's Linux and you can give it "network access" (using workarounds such as redirecting via a server), you can just use one of the existing ways to mount a remote filesystem that could be stored on the server (such as NFS, sshfs, ...).

Or bridge/mount to the local browser and store it in indexeddb or whatever.

It already has directory mapping when running outside a browser - maybe there's even an easy way to do this more directly than funneling everything through the virtual network.

Re: Container2wasm: Convert Containers to WASM Blobs

#54
Really impressed by the depth and breadth of this project, well done!

A particularly interesting part is the socket layer inside the browser. Other people solving this problem have previously used a proxy to a server that does the real socket implementation. This means you can't have a "browser-only" solution.

The author has solved this (for HTTP/S only) by proxying HTTP requests and then re-creating them as fetch requests (details here: https://github.com/ktock/container2wasm/tree/main/examples/n...). I'm very interested in using this approach for my own project Runno (https://runno.dev).

Re: Container2wasm: Convert Containers to WASM Blobs

#56
post #27
post #25

Do any GUI frameworks support WASM? I've been looking for a way to run GUI applications remotely for a while, specifically on a wlroots compositor. Projects like this (maybe one day) and https://github.com/udevbe/greenfield are interesting since they essentially make access universally accessible.

I don't know about GTK, QT, and the like, but there's a whole budding ecosystem purporting to solve it WASM-native. Dioxus [1] and about a dozen other libraries are attempting to be write-once, deploy web, mobile, desktop with native performance. They adopt a React-like component UI. The Rust ecosystem is full of stuff. There are lots of different approaches too - immediate mode drawing, canvas drawing [2], etc. Choo…

[deleted]

Re: Container2wasm: Convert Containers to WASM Blobs

#57
post #27
post #25

Do any GUI frameworks support WASM? I've been looking for a way to run GUI applications remotely for a while, specifically on a wlroots compositor. Projects like this (maybe one day) and https://github.com/udevbe/greenfield are interesting since they essentially make access universally accessible.

I don't know about GTK, QT, and the like, but there's a whole budding ecosystem purporting to solve it WASM-native. Dioxus [1] and about a dozen other libraries are attempting to be write-once, deploy web, mobile, desktop with native performance. They adopt a React-like component UI. The Rust ecosystem is full of stuff. There are lots of different approaches too - immediate mode drawing, canvas drawing [2], etc. Choo…

Makepad, very ambitious (watch the vid): https://github.com/makepad/makepad

Re: Container2wasm: Convert Containers to WASM Blobs

#58
post #25

Do any GUI frameworks support WASM? I've been looking for a way to run GUI applications remotely for a while, specifically on a wlroots compositor. Projects like this (maybe one day) and https://github.com/udevbe/greenfield are interesting since they essentially make access universally accessible.

I'm using Dear ImGui for my cross-platform projects (which includes running in browsers):

- https://floooh.github.io/visual6502remix/

- (start the emulators by clicking the little "UI" icon to get the debugger UI) https://floooh.github.io/tiny8bit/

- (start by clicking the little "UI" icon) https://floooh.github.io/sokol-html5/

Platform abstraction is handled through the sokol headers: https://github.com/floooh/sokol

Dear ImGui is small and fast enough for running in browsers (it will add up to a few hundred KBytes of WASM byte code). If this is too much "bloat", there are smaller, but also less powerful alternatives like microui: https://github.com/rxi/microui)

Re: Container2wasm: Convert Containers to WASM Blobs

#59
This is quite possible the coolest technical accomplishment i've seen in... since... well, further back then i can currently recall. On some level, even more impressive (to me) than the AI-related advances of the 2020s. Absolutely mind-blowing.

Edit: i don't mind saying that such accomplishments make me feel completely inadequate as a developer.

Re: Container2wasm: Convert Containers to WASM Blobs

#60

Shameless self-promotion: https://webvm.io Powered by a x86->Wasm JIT. Technical writeup: https://labs.leaningtech.com/blog/webvm-server-less-x86-virt...

Very nice! Most language playground sites should adopt this approach.

Yup. this is what I use for Yaksha playground (I use v86 though). See -- https://yaksha.pages.dev/
Post reply on HN