Functional Programming in a Lisp

The first programming language I used in earnest was Algol 68, in ’78. I didn’t know at the time but that was influenced by Lisp, the second-oldest high-level language still used. Lisp was specified in 1958. Algol 68 source code was constructed from ‘Serial Clauses’ which always returned a value. It’s procedures could return values, so could also be called as functions. It had recursion.

I tried a Real Lisp, as part of my university computer science final year project on semantic networks. It didn’t go well. I think I was thrown off balance by the sudden paradigm shift from imperative to functional programming (FP.) I’ve starting again with Clojure, a new Lisp dialect. I’ve also read a little about Scheme and Haskell to help me understand whether concepts I come across are Clojure, Lisp or FP.
In Lisps, including Clojure, code and data look the same, because they are.

I liked the explanation I read recently that imperative languages started with the machine and worked up to increasing levels of abstraction, such as Structured Programming and Object Oriented Programming, while functional languages started at the top and worked down, until they could be implemented. This leads to a feeling that FP hovers some distance above the hardware, rather than being firmly planted in it. In one sense, FP hovers higher now, as increases in computing machinery’s capabilities has made abstraction possible which originally was not. Pure FP isn’t allowed to have side-effects, so is isolated from changes in state in the real world. It has to operate the world by remote control, like a wizard. I like to think it shares the realm of magic with mathematics but both are dependent on computational hardware to get anything done.

Advertisement