lambdavon-neumann

von-Neumann machines and Lambdas


Brian's premise in his argument to the question "Are side effects a good thing?" is interesting:

computers are von-Neumann machines that are designed to work well with effects (rather than being designed to work well with lambdas)

I am confused by the juxtaposition of the approaches. I cannot see them as black and white. What is the proof-value of:

computers are von-Neumann machines that are designed to work well with effects [1]

The last part confuses me:

rather than being designed to work well with lambdas [2]

Are the Lambdas used as symbols for Functional programming? Or are they euphenisms for functional programing? What is the real message?

In what sense, the parts of the premise [1] and [2] are right? What are the hidden premises in the reply? Can someone justify the original premise? How do the von-Neumann machines and Lambdas really work?


Solution

  • I'm not entirely sure what you're asking, but as I read it, you're asking what he means by lambdas?

    He is referring to lambda calculus, which form much of the theoretical basis for functional programming. It is an abstract notation for (among other things) describing and reasoning about higher-order functions.

    A Von Neumann machine is basically what we have. Programs are executed by instructions manipulating and accessing a store (our RAM). That is, everything is implicitly done through side effects. Data is read from some area in RAM, processed a bit, and written back to some (other, perhaps) area in RAM. Without side effects, the CPU would be limited to manipulating whatever garbage data happened to be in its registers when it was powered on.

    Lambda calculus has no notion of side effects, so a machine based around this principle would not have the distinction between "what the CPU can access" (our registers, essentially), and "what can be accessed indirectly" (our RAM). Everything in such a machine would be based around functional principles, of functions taking one or more arguments, and returning a new value, never modifying existing ones. (And no, I'm not sure how that would work in hardware... :))

    Does that answer your question?