3 ms·
I've heard so many things about Clojure. I am a CS student with some experience in the most used languages (JS, java, python). Can someone explain in simple cs
by yagodragon 7y ago
I've heard so many things about Clojure. I am a CS student with some experience in the most used languages (JS, java, python). Can someone explain in simple cs terms why Clojure is sooo hyped? What can I do with this language that would be harder with other languages? From what I've gathered it's used in data wrangling and manipulation in general but most data-oriented tools are written in Python.
- lymitshn 7y agoMaybe more of the hype comes from the fact that its a Lisp. To get a feeling for the "magic" of lisp, I would suggest either watching SICP video lecs[0] or reading the book. I started learning lisp, almost the same time I've started learning programming with Java (college). Honestly I was thinking why they don't just teach us that, instead of Java at that time. Also Clojure is created by a fairly respected dude (afaik) Rich Hickey. His talks and Clojure design decision articles on the site are really insightful. Also this talk[1] also pretty good overview of different paradigms and `Clojure way`, imo. [0]https://youtu.be/-J_xL4IGhJA?list=PLE18841CABEA24090 https://youtu.be/-J_xL4IGhJA?list=PLE18841CABEA24090 [1]https://www.youtube.com/watch?v=vK1DazRK_a0 https://www.youtube.com/watch?v=vK1DazRK_a0
- teataster 7y agoI believe it's hyped because is a more practical/modern lisp. I don't think it provides more fundamental benefits than any other lisp than access to a plethora of standard Java libraries. E.g. I cannot Java, but knowing clojure has allowed me to maintain a large inherited Java codebase. Afaik I could not have done that in common lisp (and not only because I don't know cl). I think almost everything is harder when you are not using lisp. Also lisp tends to bring joy to its users for some reason, so there is that. Finally there is a huge difference between Python and clojure data wrangling. Pandas and spark are fundamentally table oriented, but if you are using nested dictionaries (clojure maps) you do not have those tools to help you. No matter what I was doing in clojure, it always involved processing nested maps, it's just the natural approach in the language, kinda like using classes in Java. Hope I managed to clarify something :)
- hcarvalhoalves 7y ago> I don't think it provides more fundamental benefits than any other lisp Concurrency primitives and immutable data structures are part of the core language. This is probably more interesting than the lisp part itself, which is kind of a bonus. Rich Hickey's talks stress the former aspects a lot more than the later.
- teataster 7y agoWell, those are so ingrained in clojure that I forgot about them :). I think you made a great point.
- Scarbutt 7y agoClojure doesn't have much over JS except for macros, but today you can achieve the same with Babel. If you stick to writing JS in a functional programming way like Clojure encourages to do so, you are pretty much just writing Clojure but with a little bit more verbosity for keeping things immutable and to compensate for JS's lack of standard library (fixable with libs like lodash and immerjs). When devs talk about data in Python their are referring to data science, it has a big ecosystem to support that, Clojure doesn't. Data-oriented in Clojure means using generic data structures like maps/vectors/sets to represent information, instead of creating classes for everything.
- jbritton 7y agoClojure has a focus on immutable data. With Python, a list or dictionary is mutable and with parallel execution this can result in one function mutating a list that another is using. Or even without parallel execution one may wonder if a function somewhere in the call stack is mutating a list. Jokingly called spooky action at a distance. In general mutation makes reasoning about code more difficult. Clojure has a nice set of orthogonal functions for transforming persistent data structures. Once you wrap your head around how to program by transforming data instead of mutating data, you might enjoy that method of programming. Python has pyrsistent library, but Clojure is immutable first and in Python it is not really the norm.
- GlennS 7y agoClojure is my favourite language to work in, although I only had the opportunity to use it professionally for 6 months. It gives me an overwhelming feeling of quality, forethought, and careful design. So does most of its surrounding ecosystem. I feel a similar way about Python too though. The hype probably comes mostly from good concurrency tools + immutable data structures, but at least partly it comes from people who really enjoy working in it.