# Greenspunning

Three approaches to solving problems on computers.

When faced with a computational problem there are three common approaches:

- write a program to solve the problem;
- write a tool to solve the problem and other problems of the same kind;
- write a programming language in which you can then write tools which solve problems of the same, and other, kinds.

Most people start by doing the first. Bradshaw’s corollory to Greenspun’s tenth law states:

- for problems of size \(s \ge s_1\), then, regardless of the initial approach, the final result is as if the third approach had been taken, even if this is not understood by the people solving the problem;
- there is a problem size \(s_0\) above which it is most efficient to take the third approach from the beginning;
- \(s_0 \lt s_1\).

What this means is that, if you have a sufficiently large problem (\(s \ge s_1\)) to solve then, whatever your intentions, you will inevitably end up creating a programming language as part of the solution. And there is a range of problems smaller than this (\(s \in (s_0, s_1)\)) for which the *quickest* way to solve the problem is to design and implement a programming language.

So, when approaching a problem, it is important to understand the values of \(s_0\) & \(s_1\) and how they compare to \(s\). These values are hard to discover: a good trick is to start with a platform which makes \(s_0\) very small and always take the third approach.