a field guide to resurrected wordsapocrypha

thunk

/ ˈθʌŋk /
noun · jocular past participle of think, “that which has been thought”

A computation boxed and shelved, unopened until someone asks. It has not happened yet. It may never need to.

the shelf is below. nothing on it has been computed

The Shelf

fourteen computations, boxed and unopened. none has happened. tap one and listen for the sound.
evaluation strategy
THUNK.
still wrapped
work performed
the deferrer's notenothing is computed. nothing needs to be.
forced: 0 · recomputations: 0 · calls made: 0still deferred: ∞ · evaluations you demanded: 0

Every parcel is a promise the machine has not kept yet, at a cost of nothing. Tap one and the computation finally lands — that sound is the word. Then ask for the same parcel again. Under CALL-BY-NEED the memo answers: computed once, remembered forever. Switch to CALL-BY-NAME — ALGOL's way, 1961 — and every ask does the whole job again, on principle. The fifteenth parcel is marked ∞. It stays wrapped. That is not a failure of the shelf. That is the shelf working.

Lifeline of the Word

onomatopoeia
thunk: the sound of a heavy thing arriving.

Before it named anything in a compiler, thunk was the noise a book makes on a table — arrival with mass. English keeps a shelf of these sound-words. This one was waiting for a computation heavy enough to deserve it.

1961
ALGOL 60 needs a trick, and the trick needs a name.

ALGOL's call-by-name rule says an argument is re-evaluated every time it is mentioned. Compiler writers bottle each argument into a tiny closure, generated behind the scenes. P. Z. Ingerman's team christens it a thunk — the joke being it had 'already been thunk of' by the compiler, past tense of think. The pun stuck harder than the language.

1971
Call-by-need: compute once, remember forever.

Chris Wadsworth's thesis adds the memo. A thunk that overwrites itself with its own answer is evaluated at most once — laziness without the recomputation tax. The distinction demonstrated above, name versus need, is this exact thesis, in parcels.

1990
Haskell makes the thunk a way of life.

In a lazy language everything unevaluated is a thunk — every list infinite until inspected, every value a promissory note. Haskell programmers learn to read heap profiles full of them, and to fear a million tiny parcels nobody opened. Laziness, it turns out, must also be paid for.

1990s
Windows resurrects the word for its seams.

Microsoft borrows thunk for the shims that let 16-bit and 32-bit code call each other — the universal thunk, the flat thunk, names from a plumbing catalogue. Different machinery, same soul: a small generated stub standing in for work deferred across a boundary.

2015
Redux gives every webapp a thunk of its own.

redux-thunk makes the deferred function a mainstream pattern: dispatch not a value but a computation to run later. A generation of JavaScript developers types the word daily, mostly without hearing the book hit the table.

now
The unevaluated future is a first-class value.

Promises, generators, lazy imports, speculative execution — modern computing is largely a warehouse of wrapped parcels, opened on demand or never. The word survives because the idea won. Most of what your machine could compute today, it politely did not.