4 ms·
>Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java. It's the same question I make myse
by flavio81 9y ago
>Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.
It's the same question I make myself, since after learning Clojure here I am, still using Common Lisp happily ever after.
Well, if you think that data should be immutable by default,
if you really need readymade syntax sugar for hash table and the likes,
if you don't have any need for object oriented programming, not even once a year, and if you particularly don't feel any appeal for what is by far the most advanced OOP system out there (CLOS),
if you love the Java ecosystem and need to be reminded of the J2SE libraries by using them directly all the time to do things other languages have built inside their own stdlib (but Clojure does not),
if you don't feel wrong knowing that your code won't be compatible with the .NET CLR (or other platforms) without rewriting substantial parts, despite the language still being called "Clojure",
if you don't know that basically all you can do with Clojure, including talking to Java (and also C) libs, and all sorts of concurrency things, you can also do with good old, high performance Common Lisp...
... then welcome to Clojure! Clojure is easy to learn, fashionable, well supported, and popular.
I guess that if you are into developing single page applications, Clojure can be a neat choice.
- DigitalJack 9y agoWell that was condescending.
- flavio81 9y agoMore disillusionment than condescending. I jumped on learning Clojure waiting for big, nice surprises, new stuff, or an enlightening moment, but there wasn't any. I do, however, find it easy to learn and that's a good thing. On the other hand i am not really knocking down Clojure. If somebody wants me to do a project that requires interacting with lots of Java classes, I'm really glad Clojure exists, since it liberates us from plain Java. I am also glad that it's a good "gateway drug" to Lisps in general. I'm also glad that ClojureScript exists, perhaps this is the best part of Clojure. But Clojure is not really my cup of tea. I want wide options for mutable data (for performance reasons). I want multiple paradigms, including a powerful OOP system. I want easy recursion with tail call optimization. I want explicit, detailed error messages, etc.
- simongray 9y agoI think your description is fair, although I feel like you could have started with the Clojure/ClojureScript combo for making SPAs in your first comment. That is really the biggest driver of Clojure right now, the fact that it has a mature compile-to-JS implementation that can share source code with the backend.
- flavio81 9y agoI think ClojureScript is very nice and I often recommend it to any Javascripter. I sincerely thank Hickey for liberating us from Java and plain Javascript. I think that if Clojure was pitched more as substitutes of Javaxx and less as "the improvement over Lisp", many of us Lispers would be happy. As I mentioned, it isn't an improved Lisp; it is a different language with a different (valid) philosophy which some will like.
- thom 9y agoClojure's just a bunch of specific pragmatic decisions bunged into a Lisp. If you've never had a problem selling, deploying and integrating Common Lisp apps for clients then it sounds like it would be of dubious utility to you. People will argue all your individual points because that's what people do, but honestly, you're fine, Clojure's fine, everyone's fine.
- fulafel 9y agoProtocols cover many OO use cases.
- cutler 9y agoA small detail - Clojure has 20,000 libraries of its own. See http://clojars.org http://clojars.org .
- flavio81 9y agoNpm (javascript's NPM) has over 500,000 libraries right now. Do this makes JS a better language than Clojure, or a better choice? No way. And everytime some javascript fan would go against Clj/ClojureScript use citing "Clojure has 25x less libraries", i will defend Clojure. How many libs do we really need? So far i have found all libs I needed for Common Lisp. Many of them have high quality, at least in the sense that the code is easy to understand. Most needed stuff is there - db access, key/value store, cryptography, authentication, html templating, JSON, xml, web servers, software transactional memory, parallelization, compression, networking, foreign interfaces, music, midi, all sorts of data structures, and of course tons of AI related stuff. This is not like NPM where there is a lib solely dedicated solely to left-padding a string, and when you take down this lib the whole ecosystem collapses big-time (true story). Also, just as Clojure can easily call Java code and thus have access to the huge and mature Java lib ecosystem, also Common Lisp can very easily (see 'CFFI') access the huge and mature C lib ecosystem, mind you, and this feature is leveraged a lot in CL. This also has performance benefits, since tuned Lisp code is as fast as tuned Java code, but C can often go faster. With ABCL (JVM implementation of Common Lisp), you can even call Java libs and C libs in the very same source code, which I find amazing.
- cutler 9y agoI was actually praising Clojure, ie. doesn't necessarily depend on Java libraries.