---
title: "JavaScript: From Closures to Autonomous Systems"
url: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems"
locale: "en"
author: "Mikhail Savchenko (Mike Fluff)"
updated: "2026-11-18T12:24:57.879Z"
description: "For thirty years the JavaScript runtime kept taking work off the programmer. The next thing it is asked to check is an AI agent."
alternates:
  - locale: "en"
    url: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems"
    markdown: "https://www.mikefluff.com/en/books/from-closures-to-autonomous-systems.md"
  - locale: "ru"
    url: "https://www.mikefluff.com/ru/books/from-closures-to-autonomous-systems"
    markdown: "https://www.mikefluff.com/ru/books/from-closures-to-autonomous-systems.md"
  - locale: "pt"
    url: "https://www.mikefluff.com/pt/books/from-closures-to-autonomous-systems"
    markdown: "https://www.mikefluff.com/pt/books/from-closures-to-autonomous-systems.md"
  - locale: "es"
    url: "https://www.mikefluff.com/es/books/from-closures-to-autonomous-systems"
    markdown: "https://www.mikefluff.com/es/books/from-closures-to-autonomous-systems.md"
---

# 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.

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.

- Full draft · 20 chapters, 4 interludes · free

- Text language: en (ru, en, pt)

## Contents

### Part I. Language as a Computational Model

- [Chapter 1. An Accidental Revolution](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch01) — free · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch01.md
- [Chapter 2. Objects Without Classes](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch02) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch02.md
- [Chapter 3. Functions as Data](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch03) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch03.md
- [Chapter 4. Types Checked Later](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch04) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch04.md

### Part II. A Machine That Learns to Run Code

- [Chapter 5. From Interpreter to JIT](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch05) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch05.md
- [Chapter 6. The Engine Wars](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch06) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch06.md
- [Chapter 7. Speculative Execution](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch07) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch07.md
- [Chapter 8. Garbage, Profiles, and the Limits of JIT](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch08) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch08.md

### Part III. Time

- [Chapter 9. The Event Loop](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch09) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch09.md
- [Chapter 10. Continuations](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch10) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch10.md
- [Chapter 11. Meteor's Fibers](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch11) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch11.md
- [Chapter 12. Time as Part of the Program](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch12) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch12.md
- [Interlude. Before the Abstraction Existed](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude3) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude3.md

### Part IV. Distributed Reactivity

- [Chapter 13. From MVC to the Reactive Graph](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch13) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch13.md
- [Interlude. After Meteor](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude4) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude4.md
- [Chapter 14. Meteor: The Application as One System](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch14) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch14.md
- [Interlude. Meteor Under Load](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude1) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude1.md
- [Chapter 15. Distributed State](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch15) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch15.md
- [Chapter 16. Reactivity Under Access Control](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch16) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch16.md
- [Chapter 17. The Limits of Consistency](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch17) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch17.md
- [Interlude. Revoking What Has Already Been Delivered](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude2) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/interlude2.md

### Part V. An Executor That Can Be Wrong

- [Chapter 18. A Runtime for a Nondeterministic Executor](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch18) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch18.md
- [Chapter 19. The Durable Agent](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch19) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch19.md
- [Chapter 20. The Responsibility Boundary](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch20) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/ch20.md
- [Chapter 21. Experiments](https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/appendix) — opening free, rest in the full book · Markdown: https://www.mikefluff.com/en/read/from-closures-to-autonomous-systems/appendix.md
