6 ms·
Show HN: Docker in the browser using x86-to-WASM recompilation
- ffhhj 4y agoCould this be used for GPU computation?
- stopdropnhotpot 4y agoDepends on the browser. There's standards here but not everyone is conforming.
- franky47 4y agoGary Bernhardt's talk [1] is becoming more and more of a premonition. [1] https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- spyremeown 4y agoThis is awesome, we have come full circle.
- zakember 4y agoNot until we can have a browser within this docker container
- 8jy89hui 4y agoJSLinux [0] can run a whole Alpine Linux distribution with a x window server and a built in browser. We are already past the days of browsers within operating systems within browsers. [0]: https://bellard.org/jslinux/ https://bellard.org/jslinux/
- mbreese 4y agoI don't see a network connection on the Docker host, so we have a little way to go yet. (Unless someone knows how to access the network?)
- deleted 4y ago[deleted]
- revskill 4y agoThen stack overflow error is expected.
- ASalazarMX 4y agoThis is how we killed Moore's law. It stopped but we didn't.
- MobiusHorizons 4y agoIf you already have x86 to WASM, what do you need docker for? Seems like you already have all the encapsulation you could want at that point.
- g3 4y agoIt makes for a cool demo (and it's a reference to the recent "wasm in docker" announcement).
- piersj225 4y agoLink for anyone curious https://news.ycombinator.com/item?id=33320530 https://news.ycombinator.com/item?id=33320530
- noname120 4y agoDocker is not just a container runner, it's also an API for interacting with them, a container creation language (Dockerfile), and more. Being able to run Docker enables you to get access to all these tools and build the Docker containers from other projects.
- _jal 4y agoThere's a generation of people who appear to treat docker images as a combined packaging/distribution mechanism. Instead of learning to create a .deb or .rpm, they write a dockerfile. I tend not to use that sort of thing, but not just because of docker - there's a bundle of related practices that tend to turn my eye elsewhere. YMMV.
- dboreham 4y agoResistance is futile.
- polotics 4y agoIt's very true. However what is intrinsically better about a .deb or .rpm apart from having been there first? Are they the epitome of something? This is an honest question, I am really not sure. I vaguely remember that making an rpm was unpleasant and not very well documented, but it's been about ten yeats now...
- adpirz 4y agov86 also featured by supabase running postgres in the browser: https://supabase.com/blog/postgres-wasm https://supabase.com/blog/postgres-wasm
- g3 4y agoIf you're bored (or your code is still compiling), you can also try: SerenityOS: http://copy.sh/v86/?profile=serenity http://copy.sh/v86/?profile=serenity (one of their developers contributed PAE support to v86, which is extra cool. I believe it contains their own browser.) ReactOS: http://copy.sh/v86/?profile=reactos http://copy.sh/v86/?profile=reactos Haiku: https://copy.sh/v86/?profile=haiku https://copy.sh/v86/?profile=haiku 9front: http://copy.sh/v86/?profile=9front http://copy.sh/v86/?profile=9front Android: http://copy.sh/v86/?profile=android http://copy.sh/v86/?profile=android KolibriOS: http://copy.sh/v86/?profile=kolibrios http://copy.sh/v86/?profile=kolibrios HelenOS: http://copy.sh/v86/?profile=helenos http://copy.sh/v86/?profile=helenos Oberon: http://copy.sh/v86/?profile=oberon http://copy.sh/v86/?profile=oberon QNX: http://copy.sh/v86/?profile=qnx http://copy.sh/v86/?profile=qnx Windows 95 with IE 3: http://copy.sh/v86/?profile=windows95-boot http://copy.sh/v86/?profile=windows95-boot Windows 98 with IE 5: http://copy.sh/v86/?profile=windows98 http://copy.sh/v86/?profile=windows98 (run networking.bat) Windows 2000 with IE 6: http://copy.sh/v86/?profile=windows2000 http://copy.sh/v86/?profile=windows2000 (run networking.bat) v86 running in v86 (the inner one is running in node): https://copy.sh/v86/?profile=archlinux&c=./v86-in-v86.js https://copy.sh/v86/?profile=archlinux&c=./v86-in-v86.js As well as most BSDs and Linuxes, as long as they still have i686 support.
- s-macke 4y agoCan you explain in more detail how this recompilation works? When is it triggered? Because your emulator is still very slow, and recompiling doesn't seem to help. A wiki or blog post would be helpful.
- g3 4y agoYes, I should write about v86's internals some day. Meanwhile, the code is right here: https://github.com/copy/v86/tree/master/src/rust https://github.com/copy/v86/tree/master/src/rust It's much faster with recompilation than without, but I agree that it's slower than expected (compared to, for example, qemu-tcg). There is still room for improvements (e.g. eflags updates, 16-bit instructions, call/ret optimisations, main loop), but part of the problem is limitations of web assembly (no mmap, only structured control flow) and browser engines (memory blow up on large generated wasm modules, related to control flow). The webvm folks explain the control flow problem quite well, and seem to be doing a better job than v86: https://medium.com/leaningtech/extreme-webassembly-1-pushing-browsers-to-their-absolute-limits-56a393435323 https://medium.com/leaningtech/extreme-webassembly-1-pushing...