4 ms·
Lisp isn't a functional language.
by nilved 11y ago
Lisp isn't a functional language.
- vitno 11y agoThis person is getting downvoted... but it isn't. Lisp, especially in it's early implementations is highly imperative. This is why when people talk about Clojure they always talk about Immutability, it's part of what forces a functional style on the language.
- incepted 11y agoYou're both right and wrong, it's just that "functional" has a lot of different definitions and nobody can agree on which one is correct. As a result, "functional" has become pretty much meaningless when describing a programming language.
- catnaroek 11y agoFunctional programming has always been the name of a programming paradigm that treats computation as the evaluation of mathematical functions.
- incepted 11y agoThat's one of the many definitions we have for it, yes. Plenty of people will disagree with it too.
- sova 11y agoPlease correct me if I am off the right track here, but is not the distinction the fact that: in a "functional language" or maybe "parenthentical up-cup evaluating language" functions are invoked in an encapsulating way, and no state is kept between function-cup-up-segments-of-code, but there is a R.E.P.L that (replies) when you invoke a (parens) which is, in LISP-land known as a program. However, now that I have mind-dumped that ^ I recall haskell and erlang also being called "functional" but I don't know their syntax any more than a chimpanzee knows that the sun is round.
- catnaroek 11y agoFunctional programming is a programming paradigm that treats computation as the evaluation of mathematical functions. A function is a rule that assigns, to every element of its domain, a unique element of its codomain. Note that the above definition says nothing about how functions are to be evaluated: strictly, lazily, memoizing previously computed results, or using magic. No general-purpose programming paradigm can make such decisions for the programmer.
- seiji 11y agoThat's a very HN comment. Completely wrong but delivered with strong convictions. Lisp doesn't actually exist. Lisp is just axioms. You run an implementation of Lisp allowing various operations. Some flavors actually have (practically) zero mutability. You just create functions and cons cells and the rest of the world gets built on top of those. But, pure functional systems are useless (to be purely functional would mean you can't even do I/O... your program would just heat up the computer, which, in a way, is its own form of output, so you can't ever be fully functional). Every functional language gets non-functional at some point for data processing, bootstrapping, loading/saving programs, and the best functional languages even have optional mutability constructs for performance (see: !). You can't create the most performant data structures possible if all your operations require path copying, but mutability should be reserved for internal high performance library creation and avoided in business logic/application level code to make systems easier to reason about.
- catnaroek 11y ago> Lisp is just axioms. Do you even know what an axiom is? (In mathematical logic, of course.)
- goblinking 11y agoDo you even lift bro?
- dang 11y ago> Do you even Any comment that begins with that is unlikely to be a good fit for HN. Please post civilly and substantively, or not at all. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/newswelcome.html
- catnaroek 11y agoNot saying nonsense (“Lisp is just axioms”) is part of being civil.
- pjmlp 11y agoCS language papers from the 50 and 60 don't share that opinion.
- coldtea 11y agoIf you have been around 10 years ago, including on HN, everybody considered Lisp not only "a functional language", but "THE functional language". Heck, Haskell was barely ever mentioned. Not to mention that the whole idea of functional programming was introduced to the programming world with McCarthy and Lisp. (Except if you want to say that "Lisp is not functional, it supports many paradigms" -- but I find that tired. It is, at its core, functional).