4 ms·
On the Lisp thing, looking around the programming world in 2004, you didn't see proliferation of functional concepts like you do today. In those days, "function
by moron4hire 14y ago
On the Lisp thing, looking around the programming world in 2004, you didn't see proliferation of functional concepts like you do today. In those days, "functional" meant Lisp, at least popularly. I think the big lesson of Lisp has been disseminated, though, and that is that it is more productive to write code-that-writes-code.
But I also think we learned a broader lesson that it's better to not pigeon-hole people down into a single paradigm. So what if Company A uses only the functional bits of your language and Company B uses only the object oriented bits, thus making their code "incompatible". Their code would be incompatible even if they could 100% agree on programming paradigms, naming conventions, API patterns. Because programming is so much NOT the syntax of the language, as long as it is not specifically restrictive.
- stiff 14y agoBeing 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, ...
- bcoates 14y agoI 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.
- martinced 14y ago..."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. :(
- ExpiredLink 14y ago> Even on HN. Did you mean programming.reddit.com?
- nessus42 14y ago> 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.
- stiff 14y agoI 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.
- moron4hire 14y agoI think I captured all of this pretty well with "In those days, "functional" meant Lisp, at least popularly."
- nessus42 14y ago> 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.
- justin_vanw 14y agoTo whom did 'functional' mean the same thing as 'lisp'? I'm always astonished when people conflate these two things. Lisp encourages you to put the forms that evaluate to a value in the position you would otherwise put a variable that has been set to that value, sortof code in place. That is kindof like functional programming. However, lisp does not avoid side effects or mutability, in fact virtually all operators in lisp are either destructive or have a destructive equivalent. The destructive equivalents are there because if you are limited to the nondestructive versions only you can't implement lots of algorithms without doing a bunch of consing and copying. In lots of ways it is easier to implement a performant functional language if it is pure and without side effects, because you can make strong assumptions everywhere. Lisp was much more interesting 10 or 20 years ago than it is today. Today, most languages have stolen most of the good parts of Lisp. Strong but dynamic typing (or the gross weak but dynamic typing), pass by reference only, generic data structures, garbage collection, first class functions, ability to introspect objects at runtime, and most other features it pioneered are just taken for granted in modern languages. What is left as an advantage is the lisp syntax, and advantages that come from that, such as data-as-code and therefore powerful macro systems. That is also the main disadvantage to lisp, as much as people will claim that eventually you can see through it, I have never seen anyone do math either on paper or on a whiteboard in anything but infix notation. There are infix and postfix calculators, but I have never seen a prefix calculator. TLDR; Lisp isn't really that functional unless you use a restrictive and inefficient subset of the language.
- stiff 14y agoYou are also not getting the point you complain about completely clear, it is not that "Lisp isn't really that functional", Lisp != Common Lisp and being a Lisp and being functional is to some extent orthogonal those days - Clojure is a very functional Lisp for example, similarly Racket, Common Lisp much less so. The original McCarthy Lisp paper was to a large extent a paper in theory of computation, using Lisp as a vehicle for things like proving program correctness, so that Lisp was purely functional, otherwise you could not do much formal reasoning with it. I guess to be completely clear one has first to define what one means by "Lisp".
- moron4hire 14y ago