I did two things within the same week or so[0]:

Abelson makes a very neat point that "Computer Science" is a misnomer - it's not a science, nor is it really about computers. At its core, just the study of process and the management of complexity in a process.

The argument is not limited to the use of algorithms[1] - it also applies to the glue-y plumbing-y stuff that moves data between different components in a system.

King's idea is plumbing-y. You can make a system simpler if you encode your invariants in the type system. That way, you don't need to constantly check if the invariant is true. You can just safely assume it if you use the right type.

This idea is presented strictly in terms of code, and Abelson suggests the idea doesn't need to just apply to code. Can it be generalized and applied to the non-world computer world?


...


Consider the milk you can buy at a supermarket.

In the US, the FDA defines milk. See 21 CFR 131.110. Notice it provides a set of invariants:

  1. It must be lacteal secretion from milking one or more cows.
  2. It must be pasteurized (or ultra pasteurized).
  3. It must contain at least 8.25% milk solids and 3.25% milkfat (pre-fat-skimming).
  4. ... the list goes on ...

This is sufficient to build a "milk parser". Given some generic liquid, we can try to parse it as milk. If any conditions are not met (e.g. root beer probably contains < 8.25% milk solids[2]) then the parser fails.

If the milk parser passes for some liquid, then going forward it isn't just some liquid, its milk[3]. We don't need to re-assure ourselves that the milk is from a cow and is pasteurized every time we open the fridge.

Under this interpretation, the FDA "wrote" the "milk parser". The local/state/federal government "runs" this "parser" in the milk supply chain[4]. It is much more convenient to run it as early as possible, as the parsing just needs to be run for each dairy distributor, not each supermarket (or god forbid each consumer!) Many of the alternatives are much, much worse.

Here's a sketch of the idea:

I can imagine this can be extended to other supply chain stuff. Thank you for reading!