7 First abstract nonsense interlude: Category theory
This chapter covers
Fundamentally, programming computers is all about creating and using abstractions. At the physics level, computers are human-scale boxes containing billions of tiny cages in which we control the comings and goings of small numbers of electrons. Chip designers have freed us from having to think about those electrons at all; at the chip level, we think about bits and bytes, instructions, caches, interrupts, and so on. Compiler developers add even more levels of abstraction, such as variables, objects, functions, and loops. When we write programs in high-level languages, we’re building algorithms and data structures that provide yet more abstractions on top of the fundamental ones provided by the language.
Can we be even more abstract in our thinking about computer programming? Absolutely! At various points throughout this book, we’ll take short breaks from specific data structures and algorithms to look at some of the mathematical structures from category theory that underlie modern programming languages. There are lots of reasons to pursue this fabulous side quest: