Hacker News new | ask | show | jobs
by simonw 98 days ago
> Well, there it is, the dumbest thing I'll read on the internet all week.

Rude.

In case you're open to learning, here's why I think this is useful.

The big lesson we've learned from Claude Code, Codex CLI et al over the past twelve months is that the most useful tool you can provide to an LLM is Bash.

Last year there was enormous buzz around MCP - Model Context Protocol. The idea was to provide a standard for wiring tools into LLMs, then thousands of such tools could bloom.

Claude Code demonstrated that a single tool - Bash - is actually much more interesting than dozens of specialized tools.

Want to edit files without rewriting the whole thing every time? Tell the agent to use sed or perl -e or python -c.

Look at the whole Skills idea. The way Skills work is you tell the LLM "if you need to create an Excel spreadsheet, go read this markdown file first and it will tell you how to run some extra scripts for Excel generation in the same folder". Example here: https://github.com/anthropics/skills/tree/main/skills/xlsx

That only works if you have a filesystem and Bash style tools for navigating it and reading and executing the files.

This is why I want Linux in WebAssembly. I'd like to be able to build LLM systems that can edit files, execute skills and generally do useful things without needing an entire locked down VM in cloud hosting somewhere just to run that application.

Here's an alternative swipe at this problem: Vercel have been reimplementing Bash and dozens of other common Unix tools in TypeScript purely to have an environment agents know how to use: https://github.com/vercel-labs/just-bash

I'd rather run a 10MB WASM bundle with a full existing Linux build in then reimplement it all in TypeScript, personally.

2 comments

I agree, bash, sed, etc. are great, but a VM running inside a browser seems like the least efficient way to access them. Even if you're stuck on Windows, Cygwin has been a thing for 30 years now, and WSL for ten or so? There should be plenty of ways to set up a sandbox without having the simulate an entire machine.

It sounds like what you're really trying to recreate is the Software Tools movement from 50 years ago, where there was a push to port the UNIX/BTL utilities to the widest possible variety of systems to establish a common programming and data manipulation environment. It was arguably successful in getting good ports available just about anywhere, evolving into GNU, etc., but it never really reached its apotheosis. That style of clear, easy-to-read-and-write software was still largely killed off by a few big industry players pushing a narrative that "enterprise" has to mean relational databases and distributed objects. It would be FASCINATING if AI coding agents are the force that brings it back.

This isn't meant to be a daily driver. I'd like the option to build systems that occasionally run filesystem agent loops on an ad-hoc basis, for any user. A browser is a really good platform for that.
So are Cygwin and WSL, though, for those who don't already have the luxury of being on Linux or UNIX (incl. MacOS). I'm sure there are uses for running full-system emulators inside a browser, but access to bash and sed and gawk doesn't seem like one of them. Seriously, if that's the best way to get access to good text manipulation tools, why aren't you ditching your entire OS?
Because bash and sed and suchlike turn out to be the most useful tools for unlocking the abilities of AI agents to do interesting things - more so than previous attempts like MCP.
> 10MB WASM bundle with a full existing Linux build

We'll get there I'm sure of it. In case you hadn't seen: https://github.com/edubart/webcm

> Linux RISC-V virtual machine, powered by the Cartesi Machine emulator, running in the browser via WebAssembly

> a single 32MiB WebAssembly file containing the emulator, the kernel and Alpine Linux operating system. Networking supports HTTP/HTTPS requests, but is subject to CORS restrictions

My demo here loads 12.7MB (if you watch the browser network panel) to get to a usable Linux machine, it even has Lua! https://tools.simonwillison.net/v86
Ooh that looks great, I'll enjoy exploring this!