A 116kb WASM of Blink that lets you run x86_64 Linux binaries in the browser
twitter.com
twitter.com
[^0]: https://wingolog.org/archives/2022/08/18/just-in-time-code-g...
EDIT: Nevermind I misread, duh (thought you were refering to the input binary format rather than the target architecture). Still, very cool.
You still need the user to be on a domain controlled by the attacker, so a user will be able to spot that e.g. they're not on their real bank website if they just look at the URL. And there are already attacks which emulate the entire look and feel of a real bank website and you can only spot with a bad URL.
The key benefit of this approach is that you can put another website into your website like an iframe, and have full access to the website within your site (including e.g. reading and injecting JavaScript). But your site is still sandboxed, and users still have to be tricked into going to it in the first place. Then they need to be tricked into using the real website, inside the fake website, which at this point many people are smart enough to not do anyways.
That would mean a Nuclear War, most of Silicon Valley to be inside Exclusion Zone, and millions of refugees running for life off the coast of Australia.
Also, big fan of your site and content!
- When will your suite of tools support Zig, the language?
(or interoperate with the Zig compiler?)
Sweet!
Justine, how can I learn more about how disk access (reading/writing files) works?
Is there a blank virtual disk of some kind in memory? (Ohh I’m realizing maybe this is provided by emscripten?)
Does stdio work?
Would it be possible for ncurses to work?
As you note browsers are already a capable platform, so a compact compatibility layer is good way to add support for linux binaries. ABI virtualization really deserves to be more popular as an alternative or complement to containers and VMs. Perhaps it hasn't caught on (besides Proton/WINE) because there isn't a semi-standard format/platform like docker or virtualbox.
Haven't multiple people on HN built simple direct GUI libraries that work natively and on wasm? It would be cool for apps and game binaries with (sound, graphics, networking, controller support...) to be portable across linux and web (and probably windows, macos, android, etc.) with a compact compatibility layer.
Another thing I wish were used more is character-mode graphics such as line-drawing, semigraphics, and various unicode symbols; I also wish more terminal emulators supported inline images - often I don't want to start up a new app just to plot something.
Agreed about native look and feel, but I don't think GUIs are intrinsically huge and intractable. Consider the various immediate mode GUIs posted on HN (Nuklear, Imgui, etc.) as well as the original Mac toolbox, which fit in 64K of ROM.
Thanks for the reply and for the interesting projects and posts!
Yes, there's absolutely good uses for being able to issue regular network packets from a browser, but there's also some quite serious misuses, so we can't have it.
This means that we don't need to recompile the source to a wasm target to run it in the browser, no?
It was already bad enough when websites started shipping giant, obfuscated Javascript bundles circa 2010. Now we're enabling running arbitrary x86 binaries for websites and no one bats an eye?
And wasm has been accessible for at least 4 years now, and yet nobody has given up react and typescript.
wasm is being used to do compute heavy work efficiently, and giving that data back to js. and this will allow doing that but with the 60 or so years of unix programs that already exist. code reuse to the highest extent. how cool is that?
Maybe this turns into an anti-distro, a collection of portable apps not specific to a Linux distro? (Or Linux, even.)
> Micropip or Mambalite or picomamba or Zig.
> "Better integration with conda/conda-forge for building packages" [pyodide/pyodide#795]( https://github.com/pyodide/pyodide/issues/795)
> Emscripten-forge > Adding packages: https://github.com/emscripten-forge/recipes#adding-packages
> - https://github.com/emscripten-forge/recipes/tree/main/recipe...
> -- emscripten-forge/recipes/blob/main/recipes/recipes_emscripten/picomamba/recipe.yaml: https://github.com/emscripten-forge/recipes/blob/main/recipe...
> --- mamba-org/picomamba: https://github.com/mamba-org/picomamba
From emscripten-forge/recipes https://github.com/emscripten-forge/recipes :
> Build wasm/emscripten packages with conda/mamba/boa. This repository consists of recipes for conda packages for emscripten. Most of the recipes have been ported from pyodide.
> While we already have a lot of packages built, this is still a big work in progress.
More seriously, wow -- this implementation of the Blink x86_64 emulator in WASM really is tiny!