Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. PipePipe: NewPipe hard fork implementing SponsorBlock (github.com/infinityloop1308)
    99comments
  2. Drawgent: Coding agent on a live Excalidraw canvas (tangled.org)
    18comments
  3. Show HN: Reladraw – A diagram language where you decide where to place things (github.com/reladraw)
    11comments
  4. A searchable library of forgotten public-domain film clips from 1915 onward (movingimagearchive.com)
    10comments
  5. The Lost Atomic Update on Loongson CPU (jia.je)
    4comments
  6. Fifteen years later, the Apple Cards origin story (lexontech.org)
    61comments
  7. Modern Object Pascal Introduction for Programmers (castle-engine.io)
    37comments
  8. Revealing the details of how OpenAI agents hacked Hugging Face (swarmtraces.org)
    424comments
  9. We're gonna need a lot more mathematicians (terrytao.wordpress.com)
    422comments
  10. DeepSeek Elastic Compute (DSec) (arxiv.org)
    1comments
  11. Reflections on 1,000 Days of Math (gmays.com)
    29comments
  12. Breaking Up with Google Play: Why Conversations Is Now Free (gultsch.de)
    225comments
  13. The Rise of Audio AR (dbreunig.com)
    2comments
  14. Analyzing Frontier Model Progress with My Favourite Game: Prince of Persia (blog.priyan.in)
    30comments
  15. Plan mode is dead (aymannadeem.com)
    449comments
  16. Plunging test scores are a slow-moving catastrophe (economist.com)
    230comments
  17. How to keep enjoying programming in a world of LLMs (haskell.org)
    150comments
  18. The Murky History of Soviet-Born Tetris (mitpress.mit.edu)
    23comments
  19. Banks and Credit Unions to Team Up Against Apple Pay Fees (macrumors.com)
    55comments
  20. Ollaya – Ollama for open-source, Jev-style decision models (ollaya.dev)
    138comments
  21. Experiencing writing at our recent Chinese calligraphy workshop (viewsproject.wordpress.com)
    1comments
  22. OpenAI bots meddled with multiple US Government agency sites (bbc.com)
    91comments
  23. Automattic has a new board after failed attempt to put CEO on leave (techcrunch.com)
    84comments
  24. Show HN: Jev Plays Pokémon Red (jev-pokemon.vercel.app)
    105comments
  25. Floci: Locally emulating any cloud service (floci.io)
    27comments
  26. Is your Postgres migration safe or not safe? (safenotsafe.dev)
    38comments
  27. Show HN: A Claude Code skill to analyze your chess games (github.com/brumar)
    46comments
  28. 16GB iPod Nano 3G Upgrade (tuckerosman.com)
    15comments
  29. I'm the mom in that viral Giants clip. Let me tell you about my husband (themomoftheyear.substack.com)
    137comments
  30. What even is an OS now? (sockpuppet.org)
    423comments

Show HN: Kandelo – a POSIX-compatible multi-process WASM kernel for the browser

12 pointsby 1mo agokandelo.dev
12 comments
Kandelo is an open-source, Wasm-based multi-process kernel that runs POSIX programs in browsers and Node.js.

Kandelo is still experimental, but it already runs a substantial range of existing software.

Do you have use cases for this?

We are trying Kandelo as a new foundation for WordPress Playground which runs server-side WordPress entirely in the browser. Kandelo also looks promising as a sandbox for running agents in the the browser and on the command line. On the side, we've been playing with porting games and desktop environments and even compiling runnable programs within Kandelo.

Yet it feels like there are many possibilities we haven't considered.

How would you like to use something like this?

Demos:

Some notes: The demos have been tested in desktop browsers. Unfortunately, YMMV on mobile today. Some of the disk images are large (~50MB) and may take a while to boot initially.

Main set, with Shell (bash, vim, nethack, and more), Nginx, PHP, WordPress, and Doom: https://kandelo.dev/20260819-demo/

LÖVE game engine: https://kandelo.dev/20260819-demo-love/

SNKRX running under LÖVE: https://kandelo.dev/20260819-demo-love/?vfs=love-snkrx-abi44...

Commander Keen running in DOSBox: https://kandelo.dev/20260819-demo-dos/?demo=keen

LXDE desktop PoC: https://kandelo.dev/20260819-demo-lxde/?demo=desktop-lxde

Background

I wanted an authentic OS-level foundation for running systems software in the browser and started this as a vibe-coded exploration. I figured it would end up being too slow and that we would have to offer many different ways to compromise default POSIX behavior to get anything usable. But after weeks of fighting agents, insisting on genuine POSIX compatibility as the default, I was surprised at how well the system worked without those compromises.

Nginx, PHP, Python, Ruby, Redis, and even MariaDB were able to be built using the SDK with minimal hacks.

Then we started porting games, having fun, and playing to see how far we could push it.

Notes on architecture:

There is a central, single-worker kernel, aiming to provide all supportable POSIX syscalls. Each process is a dedicated worker with independent memory. Each process thread is a dedicated worker that shares memory with threads from the same process. Syscalls are done with the process SharedArrayBuffer and the Atomics API. fork() is supported. The system is centered around virtual file system (VFS) images, and the VFS can contain lazy references to programs that may or may not be used. Vim is such a reference in the shell demo.

On GitHub: https://github.com/Automattic/kandelo

1mo agoHN ↗

This is so cool! I'm having trouble thinking of all the different use cases and potential issues with this, but I don't think anyone has done something like this before. Great work

1mo agoHN ↗

Thanks for taking a look and for kind words!

We've also had a prototype running multiplayer DOOM between browsers via WebRTC. I wonder what kinds of network applications might be interesting here.

1mo agoHN ↗

I had the idea of achieving build isolation by codemodding the Rust implementations of bash and the GNU coreutils (brush+uutils) to use a VFS (wasmtime's cap-std) backed by the real FS and then disabling anything that remained problematic. It kind of works but I'm still not particularly confident in it and I think this is probably the better approach.

The some points of trouble I ran into were dead symlinks left behind on the FS pointing to real files and escape codes interacting with the terminal (e.g. escape codes reading from the clipboard).

1mo agoHN ↗

The build isolation approach sounds interesting, but I'm not sure I understand.

Do you mean isolating build scripts by using a VFS mapped to the real FS and masking away everything the build script should not have access to?

The some points of trouble I ran into were dead symlinks left behind on the FS pointing to real files

Symlinks make this space trickier for sure.

escape codes interacting with the terminal (e.g. escape codes reading from the clipboard).

Woah. TIL this was possible.

1mo agoHN ↗

Do you mean isolating build scripts by using a VFS mapped to the real FS and masking away everything the build script should not have access to?

Yes. Essentially the idea was to find the source control root (or something configurable) and mount the real subtree into a VFS where everything interacts with the filesystem through the VFS. I can run wasm compiled versions of apps I don't really trust or run native patched versions that I do.

For background, I'm writing a UI platform in Roc [1] and using just [2] in order to script things. I had extra tokens so I decided to do an LLM port of just over to Roc to exercise the compiler (it's pre-0.1, pushing the compiler leads to crashes) and people won't have to install Rust to write apps. Like wasm, Roc code can't access the outside world without the host providing the access to the outside world so in the process of the port I thought "I don't have to make posix calls, I can put it in sandbox and lie about it" so that's how I got here. I'm fairly close to being able to do hermetic builds so that's a possibility but this is mostly an exploration of whether the idea works or not.

[1] https://roc-lang.org/ [2] https://github.com/casey/just

1mo agoHN ↗

Thanks for sharing details. It does seem like a natural place for a Wasm sandbox + VFS.

Hopefully we can make running these kinds of commands easier as the project progresses.

If you have any interest, please feel to suggest what you want or submit a PR at https://github.com/Automattic/kandelo/. It's easy to get stuck in our own heads working on these tools, and hearing from any real/potential user would be good oxygen for the project.

1mo agoHN ↗

I really like this. I think the possibilities are multiple. I will try it to test the generic POSIX compliance of my main hobby project.

What is the main plus you have over other similar projects or tools like JSLinux?

Which preprocessor directives can I expect to have if I need to write custom code when my executable is compiled for Kandelo?

What is the reason for choosing GPL instead of MIT or similar?

1mo agoHN ↗

What is the main plus you have over other similar projects or tools like JSLinux?

Good question! I had to do some research. Here's my understanding:

JSLinux is emulates a complete machine architecture. JSLinux runs in the browser's Wasm runtime, and JSLinux programs run on JSLinux. Both Kandelo's kernel and processes run directly in the browser's Wasm runtime, with the kernel fielding syscalls from processes. Kandelo does not emulate CPUs.

Pre-existing software can run on JSLinux, but software must be rebuilt to run on Kandelo.

Given the lack of CPU emulation, I would expect Kandelo to be more efficient than JSLinux, but for completeness, it's hard to beat JSLinux's actual system emulation.

Which preprocessor directives can I expect to have if I need to write custom code when my executable is compiled for Kandelo?

In general, we intend user software to be buildable by using standard C/POSIX macros with the Kandelo SDK. Does that answer your question?

What is the reason for choosing GPL instead of MIT or similar?

We have a mix of GPL and MIT licenses in this project. For software that is not linked with with user programs, we choose the GPL so that folks may build upon our work but cannot make it closed source. Software that links with user programs is intentionally MIT-licensed to avoid forcing user software into the GPL.

Here are our brief notes on the topic: https://github.com/Automattic/kandelo/tree/67ad37130e2ba4c11...

1mo agoHN ↗

How easy would it be to integrate this into something like this?

https://lerc.neocities.org (first page load initialized the filesystem in indexeddb, reload the page to boot off it). I really should automate that.

If there is enough of an API to the processes being run by kandelo, I could even build a full /proc interface for them.

1mo agoHN ↗

I feel like I'm not properly appreciating what that site does. Would you be up for explaining a bit? It fun to interact with the shell and fun to see JS implementations of core utils. How would you imagine Kandelo might integrate with it? Would it be another way to run programs in addition to the JS utils?

There is already a way to list processes that the Kandelo web app uses. To see the info, you can click the Internals button in the dock and click on the Procs tab. I'll try to follow up later with more details.

1mo agoHN ↗

Would you be up for explaining a bit?

The way this system runs is it installs a simple filesystem using IndexedDB (with a serviceworker so that files can have urls if necessary) then the JavaScript executable are run by launching a worker. The worker asks the host page for an API and gets sent a list of function calls it can use. It uses a MessagePort to the host to perform actions, so it is a little analogous to a process doing syscalls. All of the calls are passed though to the host (with theoretical auditng by the host (in practice nothing is prevented at the moment)). So when you do a chain of piped commands from the command line, it is actually launching a worker for each and passing the output along to the next (nothing fancy, could be a lot faster). The stdin and stdout that the commands use actually have multiple channels, with html, json, and raw output possible. Commands can provide different output to each channel or just one. The contents are auto downgraded to whatever the reader can handle. So a program can actually output an <img> tag but if it is piped to something that can't handle html input it will receive it as text of the html source. The sender has the option of providing text as well so it could just send the altText on the text channel if it wanted to not be displayed as html source.

Would it be another way to run programs in addition to the JS utils?

That's what I was thinking. While it's reasonable to re-implement a lot of basic commands, once you get to large pre-existing software, having a way to run them from the same environment is what's needed.

The main integration point start wold be that my environment would need to have a way to point at some data filename/url and identify that it is a thing that can be run by Kandelo. Then it would pass it to Kandelo, If it had hooks for allowing the host environment to manage operations for some file descriptors then my environment would be able to assemble something that looked like stdin and stdout to the running process.

There's obviously a lot more going on for things that do graphics. Something that hid KMS stuff inside an iframe doesn't seem like it would be impossible though.

1mo agoHN ↗

Sorry for the slow response. I was resting after some travel.

The stdin and stdout that the commands use actually have multiple channels, with html, json, and raw output possible. Commands can provide different output to each channel or just one.

This is pretty interesting!

The contents are auto downgraded to whatever the reader can handle. So a program can actually output an <img> tag but if it is piped to something that can't handle html input it will receive it as text of the html source.

Like a stream of typed entities? This is a neat idea and one I'll need to digest. What kinds of ways do you use it?

If it had hooks for allowing the host environment to manage operations for some file descriptors then my environment would be able to assemble something that looked like stdin and stdout to the running process.

I think there should be a protocol for custom mount types and made a Kandelo issue for it [1].

There's obviously a lot more going on for things that do graphics. Something that hid KMS stuff inside an iframe doesn't seem like it would be impossible though.

We have Linux-style framebuffer support and exploratory devices for direct rendering. IIRC, all target a <canvas> context from a worker, so it seems like there should be a path to rendering to one embedded in an iframe.

[1] https://github.com/Automattic/kandelo/issues/1315