6 ms·
Lisp isn't really a functional language, it just pioneered a lot of concepts in functional programming. It has almost no concept of immutability, imperative cod
by kbp 9y ago
Lisp isn't really a functional language, it just pioneered a lot of concepts in functional programming. It has almost no concept of immutability, imperative code is everywhere, and if you try to write in a pure functional style you'll probably find it awkward compared to something like an ML-style language.
Lisp is a multiparadigm language. It has closures and higher order functions and uses them where they make sense; it also has a lot of imperative constructs, and a very sophisticated object system. They all work together and make Lisp a unique, interesting language. If you're only interested in the functional parts, you'd probably be happier with Haskell or Clojure.
- kronos29296 9y agoClojure is lisp actually. It is also mutable but it makes mutability as an explicit transaction but the entire thing runs on a JVM so you can use all Java libraries (so no library scarcity for lisps). So if you are doing heavy work it is either this or Common lisp. Clojure is preferable because Java has more momentum than CL.
- kbp 9y agoArmed Bear Common Lisp[0] runs on the JVM. 0: https://common-lisp.net/project/armedbear/ https://common-lisp.net/project/armedbear/
- kronos29296 9y agoSo does Frege [0]. (Your Haskell dialect that runs on JVM) But you know what compared to something like SBCL or Clojure they are just not that popular. They do deserve more attention though. [0] https://github.com/Frege/frege https://github.com/Frege/frege
- PuercoPop 9y agoYes, Clojure is a Lisp. Lisp is also the shorthand way people refer to Common Lisp. Lisp in the context of OP means Common Lisp. Common Lisp has an implementation, ABCL, which runs on top of the JVM. Access to the Java ecosystem is a shared trait, not a difference. Being a multi-paradigm language CL has a wealth of features That Clojure doesn't and they all play well together. Except for the type system and the class system. For example, it has places and the ability to define your own setf forms. Common Lisp makes iteration easy with the lisp macro. Common Lisp has tagbody and gotos so one compile FSMs efficiently Common Lisp has an object system were the semantics are describe using the same object system. So users can extend the object model according to their needs. Clojure is designed to support one style of programming envisioned by its hypemaster. Rich Hickey is a brilliant person, and has done an excellent job designing Clojure, but Clojure approach to 'user erros' is we don't guarantee to signal an error, we may do w/e. By momentum you mean it is trending. We know mainstream programming is a pop culture, but we shouldn't encourage it by recommending one language over another based a FAD.
- flavio81 9y ago> We know mainstream programming is a pop culture, but we shouldn't encourage it by recommending one language over another based a FAD. To further underscore this point, Common Lisp was created in 1984 incorporating elements of proven late 1970s Lisps like MACLISP; CL has been successfully used on spaceships and important complex systems, and the CL ecosystem continues to evolve and grow till today. The specification has been unchanged since the '80s and probably won't change any sooner, since the language is extensible and thus can evolve as the state of the art evolves. CL is largely free from any kind of fad; everything that is built into the language is there either because (a) it has been proven to be necessary and proven to work correctly in the best way possible, or (b) was needed for backwards compatibility with earlier lisps. Clojure is a new language and tries to be nice to newcomers, but it's difficult to compete against technology that has at least 33 years of continuous evolution. Also, if you need to interoperate Java classes with CL, there's ABCL which will do it nicely. As a lisper said, "those who don't know Common Lisp are doomed to reinvent it."
- doall 9y agoThe original LISP is pure functional in the sense that you don't change state of an object.
- cronjobber 9y agoYou are right, the 1960 paper describes a language that is a pure functional language. I think it even was the first published pure functional language (pointers to earlier work welcome, of course).
- kbp 9y ago> The original LISP is pure functional in the sense that you don't change state of an object. Are you sure about that? RPLACA, RPLACD, NCONC, etc are present in the Lisp 1 Programmer's Manual dated March 1st, 1960: http://bitsavers.trailing-edge.com/pdf/mit/rle_lisp/LISP_I_Programmers_Manual_Mar60.pdf http://bitsavers.trailing-edge.com/pdf/mit/rle_lisp/LISP_I_P...
- doall 9y agoThe original paper of LISP by John McCarthy http://www-formal.stanford.edu/jmc/recursive.html http://www-formal.stanford.edu/jmc/recursive.html Or the more accessible explanation by Paul Graham http://www.paulgraham.com/rootsoflisp.html http://www.paulgraham.com/rootsoflisp.html There are only few primitives and no such things as RPLACA, RPLACD, and NCONC.
- kazinator 9y agoThey are in the Lisp 1 Programmer's Manual, also dated 1960. The white paper doesn't reproduce the entire reference manual; what are the odds?
- doall 9y agoI'm not talking about the implementation of LISP 1 by Steve Russell, but the original idea of LISP invented by John McCarthy that shows its purity, and that is before the implementation by Russell.