Chapter 5. New concepts
This chapter covers
- The von Neumann machine: a stored program computer architecture
- Compositionality—what it is and why it’s important
- Immutable values and immutable data structures
- Clarity of intent
- Cheap abstraction
You’ve seen a practical example done in FRP style. In chapter 1, we said that a new way of thinking will help you get the most out of FRP. In this chapter, we’ll continue breaking that down.
In this section, we’ll explain what the von Neumann machine is and why it’s the source of some assumptions that not only are unhelpful in programming but also turn out to be largely false. The “stored program” computer architecture (see figure 5.1) has served us well since John von Neumann described it in 1945. It’s the basis for the modern computer: the processor reads the program instructions from memory and executes them, giving rise to the manipulation of data in memory. The memory and processor are separate entities, connected by a bus.
Now we’re going to demonstrate some performance characteristics of a machine that don’t quite fit the von Neumann picture. A singly linked list is a sequence of nodes where each item contains a reference to the next item in the list. Many languages provide linked lists as part of their standard library. We’ll give the example in C because it’s close to the underlying machine instructions.