← Mike Fluff

Mike Fluff Press

JavaScript: From Closures to Autonomous Systems

How the runtime took over the programmer’s work

For thirty years the JavaScript runtime kept taking work off the programmer. The next thing it is asked to check is an AI agent.

Full draft · 20 chapters, 4 interludes · free · ≈ 3 h of reading

Chapter one opens straight away; the rest needs only a confirmed email. I do not charge for the book, and you can donate from any chapter.

JavaScript: From Closures to Autonomous Systems

About the book

I learned to program on Meteor, back when JavaScript had no promises yet. The code looked synchronous, data arrived in the browser by itself, the screen redrew itself, and for a long time I did not ask who was doing all that, or what would happen when it stopped.

In May 1995 Brendan Eich wrote the prototype of JavaScript in ten days. Thirteen years later Google, Mozilla and Apple were competing over whose engine could run it fastest, and V8 did it with a technique invented in the early nineties for the Self language. Since then the runtime has decided by itself how to lay an object out in memory and what machine code to turn a function into. The event loop, promises and Meteor’s fibers took over the waiting, and Meteor, reactive graphs and CRDTs took over keeping shared state in sync. Each handover left the programmer a share of the work, and the book goes into that share in detail, with eighteen reproducible experiments wherever, without a measurement, you would have to take it on trust.

The last chapters are about a new executor, a language model that makes mistakes no ordinary program can make, and the harness written around it in JavaScript. Responsibility, as I try to show with examples throughout the book, moves to whoever can check it more cheaply, and comes back to the programmer when there is no one left to check it.