Settings

Theme

Any Nix package, live in the browser

fzakaria.com

48 points by domenkozar · 20 comments

Reader

7 threads
yjftsjthsd-h

> we can run a Linux kernel in WebAssembly.

For a moment I thought someone did a port of Linux to wasm, but this is actually x86_64 Linux in a wasm qemu (with JIT, granted, which I suppose blurs the line). That's probably a lot more practical.

---

I'm stoked about the idea of using this for code review / bug reproduction / tutorials / demos. Obviously nix already gives you the reproducibility side of things, but running on any host system with zero setup and robust sandboxing should really improve its practical usefulness. Native nix doesn't give you "try this software by clicking a link and it works without installing anything", nor " here's some completely untrusted code someone wants you to run, and that's ~fine because it's in a browser tab".

indemnity

Every damn vibe project: “Catchy hook, descriptive explanation”. Like they’ve all got their own marketing team now.

easterncalculus

Seems very cool. I'm wondering what the next step would be for performance here. Trying python as suggested is quite slow so far.

  ~ # time python3 hello.py
  Hello World!
  real    0m 5.48s
  user    0m 4.11s
  sys     0m 1.24s
  • yjftsjthsd-h

    There's a JIT, so running the same thing more than once makes it faster:

      ~ # time hello 
      Hello, world!
      real 0m 1.89s
      user 0m 0.67s
      sys 0m 1.14s
      ~ # time hello 
      Hello, world!
      real 0m 0.97s
      user 0m 0.36s
      sys 0m 0.55s
    
    This would to me imply an obvious route of pre-warming the resumed image with your program. Or going all-in and natively compiling to wasm, but that's a much bigger lift.
  • orangea

    I think it could be made much faster by emulating Linux system calls instead of running a real kernel, and translating x86 binaries to wasm before running (using something like cheerpx).

orangea

> The first time you run a binary, it is translated from x86_64 to WebAssembly and that takes time.

If the binary is running under a real x64 linux kernel running in qemu, wouldn't that imply that the binary is never translated to wasm?

thenthenthen

Ugh cant stand the LLM-isms, cool idea tho, practical? For teaching maybe?

nektro

so sick, nice work!

rvz

Just looked at this and wondered, how much Claude AI slop went into this project and unsurprisingly a lot of it.

The entire site reeks of Claudisms and I doubt that the author even cares or knows what they are doing. The GitHub put me off immediately.

It's quite ridiculous to see such slop here and we are just going to see more of this.

  • Powdering7082

    The author's talks on nix go back to 2020: https://fzakaria.com/talks

    I suspect they know and care

  • yjftsjthsd-h

    It's a good idea, and the implementation works. Are there actual problems, or are you just complaining that AI was used?

    • rvz

      > It's a good idea, and the implementation works.

      Just because something "works" doesn't not mean it makes sense to use in the long run. It is incredibly memory inefficient and will cause the user's machine to crash. Not everyone is running the latest ThinkPad or Macbook with 64GB RAM.

      Without those considerations, I believe it is complete AI slop.

      • yjftsjthsd-h

        > It is incredibly memory inefficient and will cause the user's machine to crash. Not everyone is running the latest ThinkPad or Macbook with 64GB RAM.

        Thankfully, you don't need that:

        > Lastly, we have an upper-bound on the size of the closure we can fetch. The whole closure has to fit in tab memory, which is set to a hard limit of ~1.5GiB as of now and WebAssembly has a hard limit of 4GiB as it is a 32-bit address space.

        And it works fine on my 3-year-old phone with 8G of RAM, so I think your complete dismissal of VMs is excessive.

      • kclejeune

        you’re on hacker news, since when has “making sense to use in the long run” ever been the point?

        if you had actually read far enough to evaluate the article on its merits, you would know that this has a hard memory consumption upper bound

  • tomberek

    The ability to quickly try out and verify ideas is valuable. This would have taken immensely more time to get to a stage to reasonable verify or dismiss as an idea otherwise. This saves time for builders.

    The author cares; this is not a post-a-quick-project-as-slop-to-get-cred situation.

  • wrxd

    Have a look at the submissions from that websites. The quantity alone indicates that the author is vibing full steam.

    Nice ideas but 100% slop

    • teroshan

      That being said, isn't it the best use-case for slop? Generating working, interactive ideas to sell an idea and kick-start a discussion to see if it's anything worth pursuing?

      Rewriting it after that first MVP with a first round of inputs is better engineering anyway, right?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection