Re:Using Scala Will Make You Less Productive
by orthecreedence on Monday March 24, 2014 @01:26PM
(#7459638)
I think the biggest thing is that most lisps return values for most things.
(if a x y)
which is composable to (let ((val (if a x y)))
...)
as opposed to (let ((val nil))
(if a
(setf val x)
(setf val y))
...)
That said, not everything returns value(s), and there's nothing enforcing immutability. I'd say you can be functional in (most?) lisps if you are careful, but the language family is more geared towards general purpose programming than functional.Lisp is the original functional language. Functional language traditionally meant a language that emphasised functions as values, in particular supporting higher-order functions. Hence the word "functional".
More recently, people have confused "functional" with other features of languages like Haskell (sometimes called "purely functional"), leading to some confusion about what defines functional programming.
Here's an interesting post about the more recent changes in the phrase's meaning:
http://wcook.blogspot.co.uk/2012/07/day-functional-programmi...
Re:Using Scala Will Make You Less Productive
by barrkel on Monday March 24, 2014 @01:46PM
(#7459841)
People think of Lisp as an implementation of lambda calculus, which is at the theoretical core of pretty much all functional programming languages.
Re:Using Scala Will Make You Less Productive
by nbouscal on Monday March 24, 2014 @02:02PM
(#7459991)
Unfortunately we've overloaded the term 'functional programming' a bit too much. Foundation on the lambda calculus is definitely core to most functional languages, and I see how it would be reasonable to think of that as their defining feature, but it seems that the community has instead gravitated towards 'referential transparency' as the key thing. With the former definition, Lisps are definitely functional; with the latter, most of them are definitely not. Most Lispers I know consider e.g. Common Lisp to be a multi-paradigm language, not a functional one, for this reason.
Maybe we're just defining our terms differently, but the closest Lisp comes to a functional programming language is Clojure and before that Scheme.
This is not meant to deride Lisp in any way (Clojure is my language of choice, after all) - I think all Lisps enable a fundamentally unique way to reason about programs, but that's a characteristic of Lisp and not of functional programming languages.