Container2wasm: Convert Containers to WASM Blobs
github.com
github.com
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).
Still, very neat, agreed. Almost certainly the best you can do without having some kind of backend proxy running on either the server or the user's own machine.
Powered by a x86->Wasm JIT. Technical writeup: https://labs.leaningtech.com/blog/webvm-server-less-x86-virt...
I got as far as "powered by cheerpx", which leads me here: https://leaningtech.com/webvm/
And I'm also guessing that you guys just allow free use of the compiled wasm for demos such as this?
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.
- 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)
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.
Choosing a winner is the hard part. There are too many projects and no clear community-elected leader.
I think most languages that have been around for more than five years have some kind of GUI framework that'll run in the browser.
Very worst-case scenario, you could compile a Windows executable and run them in BottledWine :P
I wrote a simple chord finder for learning to play guitar with it pretty quickly [2], and would use it again to solve a problem like this, though I'm told immediate mode UI frameworks aren't good for things other than quick prototypes, or in my case, scratching a quick itch.
it's not impossible. in fact at an API level, React is an immediate mode gui written on top of a retained mode gui. but it's that retained mode that's providing all the features above.
which immediate mode GUIs have you used that cover these features?
My concern was moreso that there is nothing inherent to immediate mode that prevents all of those things. Someone just has to build it.
RTL tends to be more of a layout problem and has little to do with UIs. Most of my experience with immediate mode UI frameworks is in proprietary applications. I will say that we had no issues with localization and we integrated well with screen readers though none of this was in a platform independent manner. And that's usually the root of all of these issues.
For example, when iOS shipped it did not have spell checking, word lookup, translation, password insertion, etc built in as context menus on text. When those features were added by the OS, every app using the native widgets got those features for free with no work on their part.
Apps that rolled their own though, had to re-release their app. If they don't have time or their app is abandoned then their users suffer.
This is arguably one of the reasons flash was killed off. It was designed to render to a rectangle of pixels and it assumed a mouse and keyboard. Then smartphones appeared and no one was going to go back and fix millions of flash pages.
Current apps doing their own thing will have the same problem with the next UI change (maybe vision Pro for example).
Did Qt magically support all of those features on day 1? Xamarin doesn't completely support all of the iOS input properties, for example.
This feels like a straw man.
[1] https://github.com/leptos-rs/leptos, https://github.com/dioxuslabs/dioxus
[2] https://yew.rs/
[3] https://github.com/flosse/rust-web-framework-comparison#fron...
ImGui makes a specific design choice and isn’t amazingly documented. I don’t think it’s a good choice for larger scale apps. But good for tools or UIs in games, etc.
Accessibility is a nightmare with pretty much anything skipping browser layout of course.
But at the same time, please tell me this is not the future of software packaging.
Everything is on track.
Ripley: Yes, there are, aren't there?
Newt: Why do they tell little kids that?
Ripley: Most of the time it's true.
---
But yes, I do believe this has a strong, serverless future.
Then I am all for it.
Gradually reduce dependence on an emulated linux-kernel in favour of an alternative lightweight POSIX implementation that runs in pure WASM. This is something that is already done with other OCI runtimes like sysbox and gvisor.
FROM riscv64/alpine:20230208
RUN apt-get update && apt-get install -y curl
The demo really is Debian, but it seems like the docs are confused about which images use Alpine instead.vscode-container-wasm: https://github.com/ktock/vscode-container-wasm :
> VSCode extension for running containers on VSCode for the web (e.g. github.dev, [vscode.dev,]), leveraging container2wasm
Chromebooks can run vscode.dev and WASM.
Is this the best way to `git clone` and run `python -m this` in a Bash/ZSH shell on a Chromebook?
This could be useful with jupyter-repo2docker.
Edit: i don't mind saying that such accomplishments make me feel completely inadequate as a developer.
It has interesting solution regarding fs.
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 and "cat hello.txt" to read it.
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.
WASM is more or more being used to extend applications with custom functions/plugins, as well as function-as-a-service services. But they usually require writing custom code, specifically for these environments.
The ability to build standard containers, use any languages and tools, run shell scripts, etc. makes WebAssembly far more accessible. Complex applications can be tested natively, and deployed effortlessly later to environments that require WebAssembly.
From a performance perspective, this is not optimal. But from a productivity perspective, this is awesome, and definitely something to have in your toolbox when all you need is get things done.
bangs head into desk