[HN Gopher] A 116kb WASM of Blink that lets you run x86_64 Linux...
       ___________________________________________________________________
        
       A 116kb WASM of Blink that lets you run x86_64 Linux binaries in
       the browser
        
       Author : samwillis
       Score  : 200 points
       Date   : 2023-01-13 13:58 UTC (9 hours ago)
        
 (HTM) web link (twitter.com)
 (TXT) w3m dump (twitter.com)
        
       | tekknolagi wrote:
       | @jart, how does the JIT work? Have you done the kind of Wingo-
       | style wasm JIT[^0]? Or do you turn the JIT off?
       | 
       | [^0]: https://wingolog.org/archives/2022/08/18/just-in-time-
       | code-g...
        
         | [deleted]
        
         | jart wrote:
         | Blink's JIT only supports x86_64 and aarch64 at the moment.
         | Otherwise it runs in interpreter mode.
        
           | kentonv wrote:
           | But to be clear, the JIT can actually target Wasm? Like it
           | generates new Wasm modules on the fly and loads them with the
           | browser's WebAssembly API?
           | 
           | EDIT: Nevermind I misread, duh (thought you were refering to
           | the input binary format rather than the target architecture).
           | Still, very cool.
        
       | nyanpasu64 wrote:
       | Oh, this is Blink, a x86/Linux emulator in a browser, not Blink
       | the browser engine on x86/Linux.
        
         | shmatt wrote:
         | I was hoping this was for Blink, the security system by Amazon
        
           | sammy2255 wrote:
           | Not Blink the cheap alternative to Slack?
        
             | connicpu wrote:
             | So it's not gifs of people Blinking then
        
               | calin2k wrote:
               | Not the simplest microcontroller LED blink program
        
             | sneak wrote:
             | Not Blink the most dystopian iOS SSH client ever?
        
               | ckwalsh wrote:
               | Not <blink> the best HTML tag ever?
        
               | Fatnino wrote:
               | No wonder they had to put a 182 on the end. All the other
               | numbers were taken.
        
               | tomcam wrote:
               | OK I actually lol'd. that was strong.
        
               | [deleted]
        
           | rdedev wrote:
           | Not Blink, the entity linking language model from facebook?
        
             | Stratoscope wrote:
             | And definitely not Blink, the scariest episode of Doctor
             | Who ever.
        
               | artificialLimbs wrote:
               | Nor malcolm gladwell's "blink: the power of thinking
               | without thinking"
        
         | [deleted]
        
       | pvg wrote:
       | discussed a few days ago, 100ish comments
       | 
       | https://news.ycombinator.com/item?id=34250352
        
       | nottorp wrote:
       | It works only on x86 browsers i guess?
        
         | vardump wrote:
         | It runs on any CPU on any browser that supports WASM.
        
       | DrNosferatu wrote:
       | Is Justine reading this?
       | 
       | - When will your suite of tools support Zig, the language?
       | 
       | (or interoperate with the Zig compiler?)
        
         | jart wrote:
         | Justine here. I'm an avid Hacker News reader. I think Zig is
         | awesome and I'd love for my projects (e.g. Cosmopolitan Libc)
         | to support it. What makes that challenging is Zig doesn't
         | depend on the C library and instead directly talks to the
         | kernel ABIs. The Zig team might be able to add support for
         | building Zig apps on the Cosmopolitan platform, but it's less
         | likely to happen than other languages like Go, where we've
         | already received the green light from the Go team for a
         | GOOS=cosmo port. As for Blinkenlights, if Zig produces a static
         | binary which doesn't assume a 4096 byte page size, then your
         | Zig programs should work in Blink. If that's not the case,
         | email me the logs and/or executable in question, so I can make
         | sure Blink has the features you need. Please note that Zig has
         | had some roadblocks surrounding the system page size
         | https://github.com/jart/blink/issues/14
        
           | tomcam wrote:
           | > we've already received the green light from the Go team for
           | a GOOS=cosmo port.
           | 
           | Sweet!
        
         | spiritplumber wrote:
         | Move Zig for great justice
        
       | skybrian wrote:
       | I believe it's for _some_ Linux binaries, statically compiled.
       | Having a portable subset of Linux is pretty cool though.
       | 
       | Maybe this turns into an anti-distro, a collection of portable
       | apps not specific to a Linux distro? (Or Linux, even.)
        
         | westmeal wrote:
         | Hmmm... even if its for statically compiled bins anyway I think
         | this is super neato. Definitely gonna follow the author.
        
       | sgammon wrote:
       | Love jart's work
        
       | dahfizz wrote:
       | Is this useful, or just another "I ported X into the browser for
       | fun"?
        
         | jart wrote:
         | Author of Blinkenlights here. I'm a professional amateur so I
         | do everything for fun. I think it's fun to create command line
         | Linux programs. I want to be able to share the programs I've
         | made with other people. The browser provides an environment for
         | running software that's safe and easy. The problem is that most
         | existing solutions for running Linux programs in the browser
         | require emulating the operating system too. So I built a
         | program that implements the x86_64-linux abi, which is very
         | small. That way when myself and others share the programs we've
         | written, they'll load fast and download fast.
        
           | musicale wrote:
           | Terrific idea.
           | 
           | 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.
        
       | moloch-hai wrote:
       | We do not deserve Justine. She is proof of divine grace.
        
         | Vogtinator wrote:
         | This in particular is a collaborative effort of multiple
         | contributors. See the discussion on
         | https://github.com/jart/blink/issues/8 for the emscripten/wasm
         | port.
        
         | [deleted]
        
       | Kab1r wrote:
       | Am I correct in thinking networking (TCP/UDP) is impossible to
       | implement without some kind of WebSocket proxy?
        
         | danielheath wrote:
         | WebRTC lets you send messages point to point, you could tunnel
         | over that, but no, arbitrarily sending packets from inside the
         | users firewall isn't going to happen.
        
           | josephg wrote:
           | You could also open a websocket connection back to a specific
           | host and proxy raw tcp though that. But I wouldn't be in any
           | hurry to run a public proxy.
        
         | [deleted]
        
       | cs702 wrote:
       | Soon I'll be able to run my browser on Linux running inside a
       | browser running on Linux running inside a browser running on...
       | 
       | More seriously, wow -- this implementation of the Blink x86_64
       | emulator in WASM really is tiny!
        
         | flopriore wrote:
         | Soon we'll be able to remove the OS and directly run the
         | browser /s
        
           | modeless wrote:
           | It's browsers all the way down
        
           | jraph wrote:
           | Chrome OS is the closest of this we have.
        
         | [deleted]
        
         | [deleted]
        
         | remexre wrote:
         | This is https://github.com/jart/blink , not
         | https://chromium.googlesource.com/chromium/src/+/master/thir...
         | btw
        
         | ilyt wrote:
         | The final answer for browser compatibility, just ship the
         | browser version you need with the app.
        
           | teaearlgraycold wrote:
           | Electron in the browser :D
        
         | fnimick wrote:
         | Pretty sure this is the "future" according to
         | https://www.destroyallsoftware.com/talks/the-birth-and-death...
        
           | danuker wrote:
           | It's uncanny that we have a war, but he missed the pandemic.
        
       | secondcoming wrote:
       | This sounds terrible.
        
       ___________________________________________________________________
       (page generated 2023-01-13 23:00 UTC)