Live data from Hacker News

Show HN: A Lisp where each function call runs a Docker container

github.com

11–20 of 30 posts

Re: Show HN: A Lisp where each function call runs a Docker container

#12

I'm impressed GitHub managed to handle this beast: https://github.com/a11ce/docker-lisp/actions/runs/2216831271... 500+ container invocations to compute factorial(3)

I don't wanna know how much containers it spins up for fibonacci(3)

Re: Show HN: A Lisp where each function call runs a Docker container

#13
post #5

well, sure, that uses a large number of processing cycles for each small operation. But asking a frontier LLM to evaluate a lisp expression is more or less on the same scale (interesting empirical question whether it's more or less). And, if we count operations at the brain neuron level it would take to evaluate one mentally....

I'm sure in the future there will be technology to evaluate simple Lisp expressions in only milliseconds of time, spending mere joules of energy.

Re: Show HN: A Lisp where each function call runs a Docker container

#14
post #13
post #5

well, sure, that uses a large number of processing cycles for each small operation. But asking a frontier LLM to evaluate a lisp expression is more or less on the same scale (interesting empirical question whether it's more or less). And, if we count operations at the brain neuron level it would take to evaluate one mentally....

I'm sure in the future there will be technology to evaluate simple Lisp expressions in only milliseconds of time, spending mere joules of energy.

Maybe someday they'll have special hardware to efficiently run lisp expressions. A Lisp Processing Unit!

Re: Show HN: A Lisp where each function call runs a Docker container

#17
I get that it's a shitpost, but if you want to take this at all seriously, a Linux container is just a Linux process in its own namespaces separate from the namespaces of its parent or at least separate from PID 1. If you're not actually doing anything requiring OCI bases and layering, as in, like any other sane program, all your functions have the same dependencies, spawn everything in the same mount namespaces at least and just use the host. Then you don't need to mount the docker socket recursively, you don't need docker or a socket at all. This isn't really as crazy as developers think it is because they think containers in Linux are just docker. You can make system calls from within the Lisp runtime itself, including unshare, and bam, you've got a container per function call without needing to shell out and accept all the overhead of a separate container runtime.

Also why are the image builds hard-coded for amd64? Are you really doing anything here that can't be done on arm?

Re: Show HN: A Lisp where each function call runs a Docker container

#18
People here are laughing of course but I do think there is a deeper truth behind this that's worth exploring:

> A Docker image is a piece of executable code that produces some output given some input.

The ideas behind containerization and sandboxing are rather closely related to functional programming and controlling side effects. If binaries always only read stdin and wrote to stdout, we wouldn't need sandboxes – they would be pure functions.

In the real world, though, binaries usually have side effects and I really wish we could control those in a more fine-grained manner. Ideally, binaries couldn't just do anything by default but actually had to declare all their side effects (i.e. accessing env variables, config, state, cache, logs, DBUS/Xserver/Wayland sockets, user data, shared libraries, system state, …), so that I could easily put them in a sandbox that's tailored to them.

Conversely, I'm waiting for the day when algebraic effects are so common in programming languages that I can safely execute an untrusted JavaScript function because I have tight control over what side effects it can trigger.

Post reply on HN