Live data from Hacker News

Show HN: Docker in the browser using x86-to-WASM recompilation

copy.sh

11–20 of 32 posts

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#11

If 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.

There'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.

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#12
post #8

If you're bored (or your code is still compiling), you can also try: SerenityOS: 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 Haiku: https://copy.sh/v86/?profile=haiku 9front: http://copy.sh/v86/?profile=9front Android: http://copy.sh/v86/?profile=android Kolibri…

Can 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.

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#13

This is awesome, we have come full circle.

Not until we can have a browser within this docker container

I 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?)

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#15
post #11

If 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.

There'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.

Resistance is futile.

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#16
post #11

If 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.

There'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.

It'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...

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#17
post #11

Earlier quoted context omitted.

There'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.

It'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...

An rpm just needs to add the missing scripts and binaries to your existing operating system. It doesn’t need a full mini OS image to run. So an rpm will be ~2mb while a docker image of the same thing might be 150mb. Rpm and deb packages also usually contain startup scripts so any services can be set to start when your computer starts. And they can put log files and database files in your regular filesystem without any special nonsense. They run with (generally) user level access permissions, which are much more battle tested than root permissions through lxd. And they have full access to the computer’s networking devices.

Rpm/deb packages can also install man files, command line tools, gui apps, and so on that can run directly in your operating system.

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#18
post #8

If you're bored (or your code is still compiling), you can also try: SerenityOS: 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 Haiku: https://copy.sh/v86/?profile=haiku 9front: http://copy.sh/v86/?profile=9front Android: http://copy.sh/v86/?profile=android Kolibri…

And the whole story seems to be here (available via the Exit button from any of those pages): https://copy.sh/v86/ and https://github.com/copy/v86

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#19
post #5

If 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.

It makes for a cool demo (and it's a reference to the recent "wasm in docker" announcement).

Link for anyone curious https://news.ycombinator.com/item?id=33320530

Re: Show HN: Docker in the browser using x86-to-WASM recompilation

#20
post #12
post #8

If you're bored (or your code is still compiling), you can also try: SerenityOS: 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 Haiku: https://copy.sh/v86/?profile=haiku 9front: http://copy.sh/v86/?profile=9front Android: http://copy.sh/v86/?profile=android Kolibri…

Can 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.

Yes, I should write about v86's internals some day. Meanwhile, the code is right here: 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...

Post reply on HN