8 ms·
> truly functional programming languages (which includes Clojure and the other Lisps) This is wrong. I don't know how to say this... Lisps do usually support f
by mrottenkolber 12y ago
> truly functional programming languages (which includes Clojure and the other Lisps)
This is wrong. I don't know how to say this... Lisps do usually support functional programming paradigms, but most Lisps are indeed anything but functional (in the ML sense).
- dragonwriter 12y agoLisp was considered a functional programming language before ML existed. Lisps generally don't have as strong and exclusive support for the functional paradigm as some newer languages (and pretty much anything else still in use is newer than lisp), but then C++ is known as an OOPL despite having less strong and exclusive support for the OO paradigm than many older languages, so there's that.
- AnimalMuppet 12y agoLisp is a multi-paradigm language. It can be functional, but it doesn't have to be. It can be OO, but it doesn't have to be. Classifying it as "being" any of these is asking for argument, unless you have very clearly defined (and agreed-upon) definitions of what it means to be a member of one of those categories. In particular, does membership mean that you require programming in that style, or only that you allow it?
- bitwize 12y agoLisp was considered a functional programming language before ML existed. That was then and this is now. Today, functional programming means side-effect-free with a strong type system, and efficient use of higher-order abstractions over functions, including things like typeclasses to define entire morphisms given a few functions which establish relationships between objects. Lisp doesn't really support this effectively. Arguably, with concepts C++14 is more functional than Lisp.
- sramsay 12y agoI'm not sure I see what having "a strong type system" has to do with whether or not a language can be considered functional. It seems like it's just a way to say that Haskell and the MLs are the only languages that qualify. And that sounds more like PR than a formal definition. It's also not really historically accurate. People were referring to languages based on the untyped lambda calculus as "functional" before things like Hindley-Milner appeared (in the 70s). Were they (and I'm talking about PL researchers) all speaking incorrectly?
- dragonwriter 12y ago> Today, functional programming means side-effect-free with a strong type system Functional programming has always meant the style or paradigm of programming that prefers side-effect-free declarative code that can be modelled in the substitution model; type systems have always been (and remain) orthogonal concerns. A functional language is one that supports the functional paradigm, but it has never been most commonly used for languages that exclusively support that paradigm. Pure functional code is the term that has been used for code that is exclusively in that style, and pure functional language is the term that is generally used for a language that has exclusive support for that style.
- mtrimpe 12y agoThat's a very precise definition of the class of functional languages. Unfortunately in the real world the definition tends to be much more varied. ;)