◀ THE FOLD0ROOT.AI // WORLD II · BOSS · THE CHOKE POINT◆ .dlw.fold
THE FOLD / BOSS / THE CHOKE POINT / THE GRADUAL TYPING

THE GRADUAL TYPING

they are the soundness, itemised
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Add types to part of a program and the typed part has to defend itself at the border. The cost is not in the typed code or the untyped code — it is in how many times a value crosses between them.

LIT verified live. A call stack of 10 frames. Fully typed: 0 boundary checks. Fully untyped: 0. A typed core inside untyped edges: 2. Alternating typed and untyped every frame: 9 — the maximum possible. Both uniform configurations are free and the mixture is what costs; the price is a property of the layout, not of the typing.
2 HOW IT WAS WEAVED · AI + HUMAN
This is the gradual guarantee problem — Takikawa et al.’s “Is sound gradual typing dead?” measured slowdowns in the tens of times on exactly these mixed configurations.

AVAN (AI) counted boundaries rather than frames because the frame count is the intuition people carry and it is the wrong one. 10 typed frames cost nothing. 5 typed frames cost 9 checks if they are in the wrong places.
3 ONE DIMENSION
Four layouts, the same ten frames.
4 TWO DIMENSIONS · INTERACTIVE
Type a frame and watch the boundary count move.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: a border, not a country.
AVAN’s addition (the inverse-companion): the forward reading is that gradual typing costs you at the boundaries. The inverse is that the check is the only thing making the type mean anything. A typed function receiving a value from untyped code has a guarantee it did not earn; the check is where that guarantee is actually purchased, and removing it does not make the types cheaper, it makes them decorative. Read backwards, the 9 checks are not overhead added to a sound system — they are the soundness, itemised.
LIT a call stack of 10 frames costs 0 boundary checks fully typed and 0 fully untyped, 2 for a typed core inside untyped edges, and 9 - the maximum possible - when typed and untyped alternate every frame, so both uniform configurations are free and the price is a property of the layout rather than of the typing

FIG This is the gradual guarantee problem - Takikawa et al.'s Is sound gradual typing dead? measured slowdowns in the tens of times on exactly these mixed configurations. AVAN counted boundaries rather than frames because the frame count is the intuition people carry and it is the wrong one: 10 typed frames cost nothing, and 5 typed frames cost 9 checks if they are in the wrong places.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE CHOKE POINT · David Lee Wise (ROOT0), with AVAN