Speaker 1: Think about the software you rely on the most today, right,
Speaker 1: Like we look at these sleek interfaces on our phones,
Speaker 1: the seamless notifications, the smooth scrolling, and we view them
Speaker 1: as finished, polished machines.
Speaker 2: Yeah, totally.
Speaker 1: But back in nineteen seventy six, one of the absolute
Speaker 1: pioneers of computer science argued that presenting software this way
Speaker 1: is well, not just wrong, he said, it makes it
Speaker 1: completely unfit for human appreciation.
Speaker 2: Which is I mean, it is a staggering critique to
Speaker 2: level at an entire industry. Oh absolutely, And that tension
Speaker 2: really sits right at the core of our deep dive
Speaker 2: today into Edgar W. Dykstra's seminal nineteen seventy six book
Speaker 2: It's called a Discipline of Programming.
Speaker 1: Yeah, in Dykster he was looking at this rapidly expanding
Speaker 1: field back then, right and realizing that by focusing solely
Speaker 1: on the final executable code, we were basically hiding the
Speaker 1: actual art exactly.
Speaker 2: We were burying the messy, beautiful mathematical design process that
Speaker 2: you know the software in the first place.
Speaker 1: Which is like it's like looking at the final score
Speaker 1: of a chess game without ever being allowed to see
Speaker 1: the brilliant strategic moves that were actually played on the board.
Speaker 2: Right, you know who won, but you're entirely blind to
Speaker 2: the intellect that got them there exactly.
Speaker 1: And to fix this, Dykstra goes to some pretty wild
Speaker 1: extremes in this book. I mean, he actually refused to
Speaker 1: use any of the standard quote unquote higher level programming
Speaker 1: languages of his era.
Speaker 2: Yeah, he hated them. He argued that they're excessive features,
Speaker 2: like all those bills and whistles we love. They actually
Speaker 2: belong to the solution set rather than the problem set.
Speaker 1: They're just distractions, total distractions.
Speaker 2: So he just designs his own minimalist mini language specifically
Speaker 2: for this text. He forces you to strip away the
Speaker 2: hardware and focus purely on the logic.
Speaker 1: Okay, let's unpack this because the way he visualizes a
Speaker 1: program without using actual code the cardboard computer.
Speaker 2: It's just the cardboard machine. Yeah. He introduces this concept
Speaker 2: called executional abstraction. It's basically how we map different computations
Speaker 2: onto each other so our human brains can actually grasp them.
Speaker 2: And to explain this without any digital hardware, he uses
Speaker 2: the classic math problem of finding the greatest common divisor
Speaker 2: the GCD of two numbers.
Speaker 1: Right, like say one eleven and two fifty nine exactly.
Speaker 2: But he solves it using literal pieces of cardboard. He
Speaker 2: asked you to imagine two completely different cardboard machines.
Speaker 1: Okay, so the first machine, it's deceptively simple. It's just
Speaker 1: two pieces of cardboard on top of each other. The
Speaker 1: top piece says GCD one eleven two hundred and fifty
Speaker 1: nine equals and when you lift that.
Speaker 2: Flat, the bottom piece just says thirty seven.
Speaker 1: Right, just the answer.
Speaker 2: It's the ultimate black box. I mean, it gives you
Speaker 2: the answer instantly, zero friction, which sounds great, right, it
Speaker 2: sounds perfect, Yeah, but it possesses a catastrophic flaw for
Speaker 2: a mathematician. It requires absolute blind faith in the manufacturer.
Speaker 1: Yeah, you just have to trust that whoever printed that
Speaker 1: cardboard didn't like make a TYPEO exactly.
Speaker 2: There is zero visibility into the logic, and worse, it
Speaker 2: only solves that one hyper specific iteration of the problem.
Speaker 1: You're completely blind to the logic. You just have to
Speaker 1: trust the system. And trust is terrible mathematics.
Speaker 2: It really is, which is why Dykstra immediately replaces that
Speaker 2: black box with the second machine. And this one is
Speaker 2: very different, very this one is a massive piece of
Speaker 2: cardboard featuring a colossal grid of two hundred and fifty
Speaker 2: thousand points. You think of an X and Y axis,
Speaker 2: both stretching from zero all the way to five hundred
Speaker 2: and cutting right down the middle of this grid is
Speaker 2: a diagonal answer line where the X coordinate perfectly equals
Speaker 2: the Y coordinate.
Speaker 1: And to operate this massive grid, you play what he
Speaker 1: calls the pebble game, which I love.
Speaker 2: It's so good.
Speaker 1: You take a pebble and it represents your two starting numbers,
Speaker 1: so X is two fifty nine, Y is one eleven,
Speaker 1: and you place the pebble on that specific coordinate on
Speaker 1: the grid right. Then you follow one strict geometric rule
Speaker 1: as long as the pebble is not resting on that
Speaker 1: diagonal answer.
Speaker 2: Line, which it wouldn't be since two fifty nine does
Speaker 2: an equal one to eleven exactly.
Speaker 1: So you look at your axe is you form the
Speaker 1: smallest equilateral right triangle you can with them, and you
Speaker 1: move the pebble to the sharp angle of that triangle.
Speaker 2: And the geometry here it's just a beautiful physical manifestation
Speaker 2: of eucliding division.
Speaker 1: It's actually kind of wild to picture.
Speaker 2: It is because when you drop a perpendicular line to
Speaker 2: the axes and form that triangle, moving to the sharp
Speaker 2: angle is literally just subtracting the smaller number from the
Speaker 2: larger number.
Speaker 1: Ah.
Speaker 2: So, if you are at two fifty nine to one eleven,
Speaker 2: the smaller side is one eleven. Moving the pebble physically
Speaker 2: shifts your ex coordinate down by one eleven, landing you
Speaker 2: at one forty eight.
Speaker 1: You are physically watching subtraction happen in space.
Speaker 2: Yes, and you repeat that geometric slide over and over.
Speaker 2: You keep moving the pebble down and over, down and
Speaker 2: over until it eventually hits that diagonal line where X
Speaker 2: and Y are I.
Speaker 1: Tentacle, and wherever it lands on that line, that coordinate
Speaker 1: is your greatest common divisor exactly. Now, I have to
Speaker 1: be honest, My initial reaction to this was pure pushback.
Speaker 1: Oh really, yeah, I mean, wait, so, so instead of
Speaker 1: just giving me a calculator, you've made me play a
Speaker 1: tedious board game across a quarter of a million potential
Speaker 1: starting squares just to get the same results. Right.
Speaker 2: It feels like way more work.
Speaker 1: But then the genius of the trade offf hits you.
Speaker 2: Because the tradeoff is the entire point. By establishing that
Speaker 2: one single compact rule the mathematical invariant, Right, you haven't
Speaker 2: just solved the problem for two fifty nine and one eleven.
Speaker 2: You have instantly proven the outcome for all two hundred
Speaker 2: and fifty thousand possible starting positions on that board.
Speaker 1: You trade the immediate, unverified convenience of the first machine
Speaker 1: for the undeniable, mathematically proven truth of the second machine.
Speaker 2: Exactly, a single elegant argument governs every possible game played
Speaker 2: on that cardboard.
Speaker 1: And that is the true essence of an algorithm. It's
Speaker 1: not about rushing to an output. It's about establishing absolute
Speaker 1: confidence in the rules that dictate the output.
Speaker 2: Right. But if the immense power of an algorithm comes
Speaker 2: from that absolute mathematical certainty, you face a new problem.
Speaker 1: How do you actually communicate those rules?
Speaker 2: Exactly? You cannot build a system of flawless, rigid logic
Speaker 2: using a medium that is fundamentally designed for ambiguity. And
Speaker 2: this lead Dikstra to deliver a massive warning about what
Speaker 2: we currently call programming languages.
Speaker 1: Yeah, he argues that calling them languages is actually a
Speaker 1: really dangerous mixed blessing. It's a huge trap because we
Speaker 1: use natural languages you know, English, Manner and whatever specifically
Speaker 1: because they are vague. The imprecision of human language is
Speaker 1: a feature, not a bug.
Speaker 2: Right. It allows for poetry and context and nuance reading
Speaker 2: between the lines.
Speaker 1: But formal notation has to be the exact opposite.
Speaker 2: It has to be perfectly rigid. If you write the
Speaker 2: rules of the pebble game using informal words like Euclid
Speaker 2: originally did thousands of years.
Speaker 1: Ago, which was just in Greek, right, right, it.
Speaker 2: Remains completely unfit for formal mathematical treatment by an automaton.
Speaker 2: If we want to create automatic computers, we need unambiguous
Speaker 2: formal notation.
Speaker 1: Calling them programming languages tricks us into reading them like conversations.
Speaker 1: And you see this constantly today with large language models.
Speaker 2: All the time people try to.
Speaker 1: Prompt an AI to write highly specific, flawless code using
Speaker 1: just conversational English, and they get incredibly frustrated when the
Speaker 1: AI you know, hallucinates or produces unpredictable garbage.
Speaker 2: Because the natural language is too vague to hold the
Speaker 2: strict and variant logic. We are literally using the wrong
Speaker 2: tool for the job.
Speaker 1: And Dykstra saw this trap forming decades ago.
Speaker 2: He really did and he pairs this linguistic warning with
Speaker 2: a sharp critique of early computer history, because in the
Speaker 2: early days of computing, the hardware was the bottleneck.
Speaker 1: It was astronomically expensive and massive, massive.
Speaker 2: Highly limited, just incredibly clunky. Consequently, efficiency became the absolute
Speaker 2: supreme quality criterion for programming.
Speaker 1: So whatever made the vacuum tubes or the you know,
Speaker 1: the magnetic drums spin the fastest was ground the quote
Speaker 1: unquote best.
Speaker 2: Code, which is exactly the problem. Because physical hardware is
Speaker 2: inherently messy. It's full of bizarre physical quirks. So programmers
Speaker 2: started writing code that catered to those specific physical anomalies.
Speaker 1: They were optimizing for the machine, not for the math.
Speaker 2: Right, the code became a truthful reflection of the hardware's weirdness,
Speaker 2: completely sacrificing the logical beauty of the algorithm.
Speaker 1: We were hacking the limitations of the cardboard instead of
Speaker 1: focusing on the pebble game itself.
Speaker 2: That's a great way to put it, and Dykstra argues
Speaker 2: vehemently that we have to redress this balance. We have
Speaker 2: to put the pure algorithm back in the center of
Speaker 2: the universe.
Speaker 1: I love how he phrased it in his view, the
Speaker 1: fact that a piece of metal and silicon can actually
Speaker 1: execute the algorithm is just a lucky accidental circumstance.
Speaker 2: It's such a radical reframing. The execution is secondary, the
Speaker 2: mathematics are primary.
Speaker 1: So what does this all mean? If we accept that
Speaker 1: the physical machine is just a lucky accident, we have
Speaker 1: to ask how a program actually organizes its reality in.
Speaker 2: The abstract, right, how does it manage what we call
Speaker 2: a state space?
Speaker 1: And the way he describes building this state space is
Speaker 1: fascinating because it's historically humans named numbers haphazardly. Right, We
Speaker 1: just invented new words as we needed them.
Speaker 2: Like a child counting, just making up sounds.
Speaker 1: Exactly, which is impossible to scale. It wasn't until we
Speaker 1: adopted systematic nomenclature rules that let you drive the next thing,
Speaker 1: like the decimal system, that mathematics really exploded.
Speaker 2: Because systematic nomenclature is about defining boundaries rather than trying
Speaker 2: to memorize infinite lists. And in computing we build state
Speaker 2: spaces the exact same way.
Speaker 1: Okay, walk us through that.
Speaker 2: So Deekster ask us to imagine the mechanical register. Picture
Speaker 2: a machine with eight wheels, and each wheel holds ten
Speaker 2: digits zero through nine.
Speaker 1: Like a combination lock.
Speaker 2: Exactly like a lock, but simply combining those constraints you
Speaker 2: create a Cartesian product. You instantly define a rigid state
Speaker 2: space containing exactly one hundred million distinct possible states.
Speaker 1: Wow, and once you have that perfectly defined mathematical space,
Speaker 1: you don't have to wander through it blindly. The source
Speaker 1: provides this incredibly elegant example of using equations what he
Speaker 1: calls predicates to define specific conditions within that massive space
Speaker 1: without ever listing them all out.
Speaker 2: Right, because listing one hundred million states would be impossible.
Speaker 1: Yeah, so you don't have to list out all three
Speaker 1: hundred and sixty five days of the year to tell
Speaker 1: a system what Christmas is.
Speaker 2: Well, you just define the state, right, You just.
Speaker 1: Define it as month equals December and day equals tots
Speaker 1: five or day equals twenty.
Speaker 2: Six, or defining payday is simply day equals twenty three.
Speaker 2: It is a compact, flawless way to slice through a
Speaker 2: massive Cartesian product. It's so clean it is. And this
Speaker 2: exact mechanism leads to Diykstra's first major surprise while writing
Speaker 2: this book, The immense power of predicate transformers.
Speaker 1: Okay, now this sounds incredibly theoretical, but the application is
Speaker 1: deeply practical, isn't it.
Speaker 2: Oh completely, Because in the early days, programmers would get
Speaker 2: lost trying to track every single intermediate state a machine
Speaker 2: passed through during execution.
Speaker 1: Like tracking a pinball bouncing around exactly.
Speaker 2: It was just total mental overload. Credicut transformers allow a
Speaker 2: programmer to skip that MetalMan. They let you define a
Speaker 2: direct relation between your starting state and your final state. Okay,
Speaker 2: They introduce the formal concept of ROUP, which stands for
Speaker 2: the weakest precondition. The notation literally looks like rupip and
Speaker 2: then in parentheses S comma R, where.
Speaker 1: S is the system or the program you are running,
Speaker 1: and are is the result like the post condition you're
Speaker 1: desperately trying to achieve.
Speaker 2: Right, So calculating the weakest precondition is essentially asking what
Speaker 2: is the absolute broadest, most lenient safety net I need
Speaker 2: to string up before I hit GO to mathematically guarantee
Speaker 2: that this system will land exactly on my target.
Speaker 1: So you are fundamentally working backwards, entirely backwards. Instead of
Speaker 1: starting a program and just hoping it gets to the
Speaker 1: right answer, you start with the undeniably true answer and
Speaker 1: calculate the exact conditions necessary to make it inevitable.
Speaker 2: Yes. And this mathematical rigorousness brings us to property one
Speaker 2: of his predicate transformers, and I just have to say
Speaker 2: it possesses quite possibly the most poetic name in the
Speaker 2: entire history of computer science.
Speaker 1: Oh, it really does. The law of the excluded miracle.
Speaker 2: Law the excluded miracle.
Speaker 1: Which, beyond just sounding beautiful, it perfectly grounds this abstract
Speaker 1: math in an unbending reality because it states that if
Speaker 1: your final goal, your desired post condition are is a
Speaker 1: logical impossibility, which is represented by the state of false right,
Speaker 1: then there is no starting condition in the universe that
Speaker 1: can guarantee you will get there.
Speaker 2: In formulaic terms, wop of s false equals false.
Speaker 1: You cannot ask the machine for magic.
Speaker 2: No, if your desired destination contradicts logical reality, no amount
Speaker 2: of clever programming, no perfect starting conditions, nothing will bend
Speaker 2: the universe to reach it. The system will fail. The
Speaker 2: miracle is excluded.
Speaker 1: Which is deeply comforting in a way. You know it
Speaker 1: provides a bedrock of certainty. But all of this flawless
Speaker 1: invariant logic relies on one massive assumption. What's that It
Speaker 1: assumes that if you set the starting conditions perfectly, the
Speaker 1: mechanism itself will carry out the steps exactly as planned.
Speaker 1: But anyone who has ever used a piece of technology
Speaker 1: knows that things don't always go according to plan.
Speaker 2: The hardware betrays the math.
Speaker 1: Exactly the hardware betrays the math.
Speaker 2: And this realization leads directly to Dykstra's second and perhaps
Speaker 2: most profound surprise in the book, Because up to this
Speaker 2: point in computer science history, deterministic machines were the unquestioned holy.
Speaker 1: Grail, deterministic meaning perfectly predictable.
Speaker 2: Right, The entire discipline was built on the assumption that
Speaker 2: identical initial states must one hundred percent of the time
Speaker 2: yield identical outcomes, utter unbreakable predictability.
Speaker 1: But the physical world doesn't really like perfect predictability, does
Speaker 1: it not at all?
Speaker 2: And Dykester shares this genuinely harrowing story from nineteen fifty eight.
Speaker 1: Yeah, this part blew my mind.
Speaker 2: He was working with a new machine that featured an
Speaker 2: io interrupt, basically an external hardware signal that could asynchronously
Speaker 2: pause the current process. Right, And because this interrupt was
Speaker 2: tied to physical timing rather than logical steps. It caused
Speaker 2: irreproducible nondeterministic behavior.
Speaker 1: Meaning the machine would execute differently even when provided the
Speaker 1: exact same initial state exactly.
Speaker 2: A hardware glitch or you know, a microsecond timing delay
Speaker 2: would evoke an erratic error that you couldn't reliably reproduce
Speaker 2: to study. It was a ghost in the machine, a
Speaker 2: total ghost, and Dyscher was paralyzed by this. He literally
Speaker 2: referred to the machine as an intractable beast.
Speaker 1: Intractable beast.
Speaker 2: He was so terrified by the prospect of having to
Speaker 2: build reliable, flawless software on top of a fundamentally unpredictable
Speaker 2: foundation that he delayed a major software design decision for
Speaker 2: three entire months.
Speaker 1: Wait, three whole months, three months over one unpredictable interrupt.
Speaker 1: That is just It really illustrates how foundational perfect determinism
Speaker 1: was to their entire worldview.
Speaker 2: Back then, it was everything to them.
Speaker 1: Unpredictability wasn't just a bug, It was the colle apse
Speaker 1: of mathematical certainty itself.
Speaker 2: Right. But eventually he has this massive psychological and mathematical breakthrough.
Speaker 2: He realizes that his terror wasn't because the machine was
Speaker 2: inherently broken. His terror stemmed entirely from a lack of methodology.
Speaker 1: He didn't have the mental models to process the unpredictability.
Speaker 2: Exactly, and when he finally develops those models, he flips
Speaker 2: the entire paradigm of computer science on its head. He
Speaker 2: comes to regard nondeterminacy as the normal default situation of
Speaker 2: complex systems.
Speaker 1: He decides that perfect determinism, the thing they had worshiped
Speaker 1: for decades, is actually just a special, highly restricted, and
Speaker 1: in his own words, not even very interesting case of nondeterminacy.
Speaker 2: It completely shatters the illusion. It's like accepting that friction
Speaker 2: is the reality of the physical world and a frictionless
Speaker 2: vacuum is just a highly specialized laboratory condition.
Speaker 1: That's a perfect analogy.
Speaker 2: And once Diyster accepts this, he begins building constructs that
Speaker 2: actively embrace a level of nondeterminacy rather than fighting it.
Speaker 2: He stops overspecifying how the machine.
Speaker 1: Should behave Here's where it gets really interesting. The source
Speaker 1: gives a brilliant example of this with his concept of
Speaker 1: concurrent assignment. Yes, the concurrent assignment, because in traditional highly
Speaker 1: deterministic programming, if you want to swap the values of
Speaker 1: variable x and variable Y.
Speaker 2: You can't just swap them, No, you can't.
Speaker 1: You have to create a temporary third variable. You move
Speaker 1: x to tempt, then you move Y to X, then
Speaker 1: you move temp to hy. It is a rigid, hyper
Speaker 1: sequential step by step march.
Speaker 2: It forces a strict chronological sequence where none is logically necessary.
Speaker 2: You're basically over constraining the machine.
Speaker 1: Right, and Deekstra's concurrent assignment elegantly sidesteps this whole dance
Speaker 1: by simply writing X comma Y becomes y comma x right.
Speaker 2: Just swap them simultaneously.
Speaker 1: You define the post condition, the values are swapped, and
Speaker 1: you leave the exact mechanical sequencing slightly ambiguous. You allow
Speaker 1: for nondeterminacy in the how safely bounded by the mathematical
Speaker 1: invariant of the what.
Speaker 2: You stop micromanaging the intractable beast and you start guiding
Speaker 2: it with flawless logic.
Speaker 1: Which perfectly synthesizes the massive journey Diekstra takes us on
Speaker 1: in this book. I mean he wanted to pull us
Speaker 1: away from being glorified mechanics just endlessly catering to the
Speaker 1: physical anomalies and sequential limitations of whatever metal box happen
Speaker 1: to be sitting on our desks.
Speaker 2: We start with that massive cardboard grid, realizing that true
Speaker 2: algorithmic beauty isn't about getting a fast answer, It's about
Speaker 2: establishing a mathematical invariant that proves the truth across a
Speaker 2: quarter of a million possibilities right.
Speaker 1: And we learn to abandon the dangerous vagueness of natural languages,
Speaker 1: recognizing that human ambiguity has absolutely no place in the
Speaker 1: rigid architecture of an automaton.
Speaker 2: Exactly, we arm ourselves with predica transformers. We learned to
Speaker 2: work backwards from our desired reality to find that weakest precondition,
Speaker 2: always always respecting the law of the excluded miracle.
Speaker 1: We cannot ask for magic.
Speaker 2: We cannot ask for magic.
Speaker 1: And finally, we watch one of the greatest minds in
Speaker 1: the field suffer a three month panic attack over an
Speaker 1: unpredictable interrupt, only to emerge with the absolute revelation that
Speaker 1: rigid determinism is a myth.
Speaker 2: Nondeterminacy is the true nature of complex systems, and true
Speaker 2: programming elegance is learning to mathematically guide that unpredictability rather
Speaker 2: than fearing it.
Speaker 1: He elevates software from a mechanical chore to a goal
Speaker 1: directed activity of profound mathematical beauty. He asked us to
Speaker 1: look past machine and marvel at the logic itself.
Speaker 2: It's a beautiful way to look at the world, which leaves.
Speaker 1: You, the listener, with a really fascinating lens through which
Speaker 1: to view the technology surrounding you today. Because we live
Speaker 1: in an era that is increasingly dominated by massive AI
Speaker 1: models and neural networks that are fundamentally, by their very architecture,
Speaker 1: non deterministic.
Speaker 2: They absolutely are.
Speaker 1: They hallucinate, They surprise us. They produce irreproducible outputs. If
Speaker 1: a pioneer like Diikstra realized way back in nineteen seventy
Speaker 1: six that unpredictable, non deterministic systems are the normal state
Speaker 1: of reality rather than a glitch to be feared.
Speaker 2: How should that change your expectations exactly.
Speaker 1: When an algorithm surfaces a bizarre result, or an AI
Speaker 1: gives you an answer you didn't anticipate. Perhaps the system
Speaker 1: isn't broken. Perhaps we are simply still stubbornly demanding the
Speaker 1: flawless cardboard determinism of the past from the wonderfully and
Speaker 1: tractable beasts running our future.