JavaScript: From Closures to Autonomous Systems

Chapter 20. The Responsibility Boundary

Part V. An Executor That Can Be Wrong6 min

20

The Responsibility Boundary

When I was learning to program on Meteor, it never occurred to me to ask who stores my function’s continuation while it waits for the database, who decides what to re-render on screen, and who checks what the client is allowed to see. Someone else did all of this, and did it well, until they stopped. In this book I have tried to work out who exactly, and what happens when they stop. It is time to put the answers together.

Ch. Taken by the runtime Left to the programmer How to see it
3, 8 freeing memory references to what is no longer needed heap snapshot, experiments 02 and 07
5–7 choosing machine code stable object shapes –trace-deopt, IRHydra
10, 11 storing the continuation places where a function yields control await in the text
12 process time (Temporal) cancellation, determinism the process log
13 what depends on what dependency lists in hooks Vue and React devtools
14, 15 delivering data and guessing the answer stub matching the server, idempotency Kadira
16 removing inaccessible data from the copy permission model, what to send at all subscription log
17 the merge rule (CRDT) invariants that need coordination version history
18, 19 checking an agent’s step, its memory what to give the agent, idempotency keys, sign-offs the agent’s log

The table looks like a one-way story: more and more work passes from the programmer to the runtime. That is what I thought when I sat down to write this book. But looking closely, the table has rows that do not fit this story, and they deserve a separate word.


First, what repeats. In the second part V8 watched the program, bet that it would keep behaving the same way, checked the bet on every call and rolled back to slow code if the bet lost. In the fourth part Meteor watched a method, bet that the server would do the same as the stub, checked the server’s answer and rolled back the stub’s changes. In the fifth the agent harness bets that a proposed action is safe, checks it against the schema, permissions and data provenance, and holds dangerous steps until a human signs off. The cycle «observe, bet, check, roll back» appears in this book so many times that it is unlikely to be a coincidence. Three of its parts carry over from one field to another almost unchanged: watching what the executor does, a rule that must not be broken, and a way back to a safe state.

Free, one step away

The rest of the book is free

Leave your email and I will send a link to confirm it. Once you click it, every chapter opens here, on this device, for a year. When a new book comes out I will write to this address; reply “stop” to any email and I will not write again.

Have an INITE account? Sign in and the book opens without an email.

I do not charge for the book. If you would like to support it, you can donate from any chapter.

How your email is stored