Staged Computation: The Technique You Did Not Know You Were Using

Konrad Hinsen · Computing in Science & Engineering · 2020

The kind of staged computation that will discuss here is something quite different: It is the very use of compilers. A compiler transforms a program from one notation ("source code") to another notation ("executable binary"). Executing a piece of source code thus requires two stages: the first stage, compilation, produces the code that is run in the second stage, execution. But that is not the end of the story. The compiler you run is typically an executable binary stored somewhere in your computer's file system, and so are the libraries that a program makes use of. These binaries have been produced by someone else, on another computer, using yet another compiler. So our two-stage computation is really a many-stage computation, with the results of the initial stages stored on some server for downloading by people like you. Package managers, such as apt used by Linux distributions such as Debian or Ubuntu, or Homebrew for macOS, make this approach straightforward in practice.

Read the paper · More papers on PaperTik