Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Being a "Lisp" is a very broad category and I always wondered about people calling Lisp a functional language. I would love to see a list of things that are today considered functional that originated in Lisp, I think there is not that many of them in the end. However, there is a ton of things that have nothing to do with being functional that originated or got popularized by Lisp: garbage collection, lists as the fundamental data structure, dynamic typing,... One could just as well consider it the first "scripting" language, a spiritual predecessor to Python, Ruby, maybe Smalltak to a extent? Many Lisp dialects do not stress the functional part all that much and lots of Lisp code is written in a way that is very imperative. In the end I think many other factors contributed much more to the popularization of functional programming.

And if you take Common Lisp as an example of a Lisp, there are still tons of interesting things that are far from being mainstream. Multiple dispatch, conditions system, macros, ...



I think the common programmer considers first-class functions and closures as 'functional' features. This is from the bad old days when procedural languages didn't usually have these things.


> Being a "Lisp" is a very broad category and I always wondered about people calling Lisp a functional language.

I don't understand how anyone who has studied programming language history could not understand that Lisp, and APL to no small extent, are the languages that initially defined what it means to be "functional".

Scheme, which is a hugely influential dialect of Lisp, is unambiguously functional, and Lisp in general is clearly derived from lambda calculus, which is the origin of functional programming.


I understand this, see my comment above, but when you speak of "the programming language Lisp", the way you speak about Python or Ruby, it most commonly refers to Common Lisp, that is and was the most popular implementation and its common usage was hardly functional. Part of the confusion is also that what today goes as "functional" is not only about functions as first-class objects but also very much about minimizing mutable state and this isn't something that was emphasized by first Lisp implementations.


> it most commonly refers to Common Lisp

That's not my experience at all. "Common Lisp" is used to refer specifically to Common Lisp. "Lisp" refers to the entire Lisp family. When I took SICP at MIT, Sussman and Ableson referred to Scheme as "Lisp" more often than they referred to it as "Scheme". Check the online video taped lectures if you don't believe me.

Additionally, lists in Lisp are the definitive persistent functional data structure. Sure, you can use rplaca and rplacd to modify a list, but this is very rare (not to mention dangerous) to do. Also, courses taught using Lisp typically focus on recursive solutions.


I think I captured all of this pretty well with "In those days, "functional" meant Lisp, at least popularly."


..."I always wondered about people calling Lisp a functional language"

Even more interesting: why do people call a family of language a language? elisp, for example, certainly doesn't put the emphasis on FP. But Clojure does (although you can use Clojure in a non-functional way).

But it's not that much of a surprise: nowadays talks about FP are everywhere, so programmers who think they understand FP use the term for everything.

For example you can have Excel spreadsheet having cells which shall always update themselves automatically from the network: like a cell containing the current date. Or a cell containing the current exchange rate between this and that currency.

Yet recently on HN in every single thread about Excel you had armies of retards explaining that "Excel was the ultimate functional programming language".

People are really that retarded. Even on HN. And it's frankly sad.

:(


> Even on HN.

Did you mean programming.reddit.com?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: