6 ms·
Is Clojure not considered a true lisp?
by bgorman 5y ago
Is Clojure not considered a true lisp?
- deleted 5y ago[deleted]
- waffletower 5y agoClojure is a lisp-1, but its design favors immutable data structures and attendant functional forms. These design choices do have detractors in the various lisp communities.
- eatonphil 5y agoScheme shares the attributes you mentioned.
- Turing_Machine 5y agoOr even more so, Racket. There are purists who don't consider Racket or even Scheme to be Lisps, either. FWIW, I do not agree with them (I also consider Clojure a Lisp), but they exist. There's a certain highly vocal contingent of Lisp fans who consider the Common Lisp spec to be some kind of sacred document, and that anything that's been invented in the past 37 (!) years is useless. IMO, those people have done far more harm than good for Lisp and Lisp-like languages. And yeah, there's a lot of the same religion-like purity around Rust nowadays.
- Zababa 5y agoSame thing with Haskell, in the last month I had a few people argue with me that if a language isn't Haskell, it's not functional programming.
- tephra 5y agoI've talked to several people who equate fp with "advanced type system" and not "programming by function composition" (which for me is the correct definition).
- erik_seaberg 5y agoComposition is table stakes now, I’d say pure functions (no side effects) are what make FP important with or without types.
- Zababa 5y agoI think the focus on "pure functions" is a bit Haskell-centric, as those are the guarantees that Haskell gives easily, but that's it. For example, Koka has total functions (https://koka-lang.github.io/koka/doc/book.html#why-effects https://koka-lang.github.io/koka/doc/book.html#why-effects), which gives more guarantees that pure functions. Lack of side effect is, I think, a side effect of searching for greater function composition. The goal of purity is to make functions easier to compose after all.
- JoelMcCracken 5y agoWell, you can still have pure functions without having an effects system. It just isn't checked. I think that's generally part of the mark of functional programming. If you do have side effects in some parts of the program then that part would be not functional.
- erik_seaberg 5y agoThat could be useful. Does Koka reject a total function that might not always terminate, or trust the author?
- Zababa 5y agoFrom what I understand, Koka relies on inference, so for example a function with a "while" or a recursive call will be marked as "div". I think the goal is to have the precision of Haskell, and even better, but without forcing the use of monads or something like that.
- zerr 5y agoMost important distinction - out of all Lisps, only in Clojure it is encouraged to use primitive types directly. Higher level abstractions, "inventing your own languages" are considered as a bad style.
- vindarel 5y agoyeah but this list was started for CL. At that time we only had http://pchristensen.com/blog/lisp-companies/ http://pchristensen.com/blog/lisp-companies/, and people giving the same 3 examples. Clojure always had good promotion and it already has https://clojure.org/community/companies https://clojure.org/community/companies
- Jach 5y agoIt's kind of a boring and tired point, but for another perspective on "is X a Lisp?" it's worth reviewing the Lisp 1.5 manual from 1962: http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf http://www.softwarepreservation.org/projects/LISP/book/LISP%... Consider the program at the bottom of page 29 that calculates the length of a list. What's the delta to get it to run in X? In Clojure, quite a lot of modification is needed. Scheme, slightly less. Common Lisp though, all you have to do is change the archaic top-level "DEFINE (( (LENGTH ..." to "(defparameter LENGTH...", and "ADD1" to "1+", and to call it change "LENGTH ((A B C D))" to "(LENGTH '(A B C D))", similar for "LENGTH (((X . Y) A CAR (N B) (X Y Z)))". The features of cons cell lists (including the syntax (X . Y)), lambdas, PROG, setq, labeled gotos, and even being able to use SHOUTING names if you want, have all been retained throughout the decades. The program from 48-51 works as an example too. Here's a small driver someone wrote in CL to run it without having to modify it: http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html http://www.informatimago.com/develop/lisp/com/informatimago/... One notable feature is that of being able to TRACE a function, which is quite handy, and is retained in modern Lisp systems. You could write such a driver in any language, sure, but it wouldn't be as small and simple in anything but Common Lisp, because so many of the functions in Appendix A have been carried forward through history with many Lisps until Common Lisp, so you can just pass them through to the base Lisp, no need to remap and wrap things/write a small interpreter like you would in Clojure/Scheme. A language that just ignores all of that history and makes no attempt to be backwards compatible with any of it can't be considered a "true Lisp", even if it shares other Lispy features. But again, it's a tired argument, and whether someone disagrees isn't very important. To me, Clojure is a Lisp-inspired language (like so many others, e.g. Julia), and is attractive on its own merits, without having to crib the good name of Lisp.