3 ms·
It's been almost 2 months since I started learning Clojure+ClojureScript. The language itself is beautiful and very powerful, you feel like you're gaining new
by codeshaman 11y ago
It's been almost 2 months since I started learning Clojure+ClojureScript.
The language itself is beautiful and very powerful, you feel like you're gaining new superpowers as you learn it.
You also start to understand your imperative languages much better as you learn Clojure and grasp concepts like functional programming, data (im)mutability, runtime polymorphism and get some new insights into concurrency.
Lisp's Code is data and 'data is all you need' is an extremely powerful concept too.
Interactive development is a really cool thing.
But the path was not all flowers, I must confess.
I've struggled for weeks with the editors and Repl integration (I chose Cursive eventually), setting up the projects and the workflow for clojure, browser and node.js vm.
We have a tendency to try and adapt the stuff we learn to the things we already know and sometimes I did just that, trying to fit a square into the circle that I know and it never quite fits. It's best if you 'forget' all your previous programming knowledge and just go with the Clojure/ClojureScript way of doing things.
The language (and especially the tools/libs) are evolving rapidly so check the date on the articles you read: if earlier than 2014, chances are things are done differently now.
Also, the best way to get help fast is through the IRC channels on freenet. I would have saved days if not weeks if I've figured this out earlier.
That being said, ClojureScript is not like CoffeeScript. While it compiles to javascript, there's little benefit in using it as a 'javascript dialect'. It's power is in it's ability to be Clojure in the browser and the most benefit is when you have the tandem of clojure server and clojurescript client (which is actually one single application - go figure).
You can also feel that clojure is on the rise right now - there's stuff appearing every day - articles, books, libraries and cool demos, I think programmers are just starting to grasp the true power of the 21st century lisp. It kind of feels like the early days of node.js, so things will definitely grow in the future.
- davexunit 11y ago>I think programmers are just starting to grasp the true power of the 21st century lisp. Now, if programmers would only realize that Scheme and Common Lisp are even better and start using them more. It's nice to see a Lisp get some mainstream acceptance, but it's unfortunate that it has to be Clojure.
- codeshaman 11y ago>but it's unfortunate that it has to be Clojure Could you elaborate on that a bit ? Why is Scheme/CL superior to clojure ? I chose to explore Clojure out of practicality. Clojure has the jvm (and the ocean of libs for it) and javascript (with another ocean of libs) on it's fingertips and in theory it allows you to build any modern application.. While CL, Scheme doesn't seem to have as much library support (although I honestly don't know a lot about either of them).
- davexunit 11y ago>Why is Scheme/CL superior to clojure ? Clojure's license choice is unideal: the GPL-incompatible Eclipse Public License. On the JVM, it's startup performance is quite slow, and personally I don't like the Java environment at all. Furthermore, the syntax choices baffle me: Having to specifically know when a form uses () or [] is just odd. The 'let' form stands out as a good example of Clojure's bad language design choices. There's also no tail-call optimization, one has to explicitly use a 'recur' form to approximate it. I'll stop here. Now that I've ranted about that, here's what I like about Clojure: The persistent data structures and the concept of transients. Both of these can be implemented in the Lisp of one's preference, though, and someone's already done the basic work for my Lisp of choice: Guile Scheme. >CL, Scheme doesn't seem to have as much library support Any decent CL or Scheme implementation gives you access to a C FFI, which provides another ocean of libs. But yes, there are fewer libraries generally, but people were okay with that for Clojure. Clojure hackers wrote a whole bunch of libraries because they were excited about the power the language gave them. If more people would recognize the immense power and value of CL and Scheme, libraries would cease to be an issue, people would write the missing bits. I work on a GNU/Linux distribution written almost entirely in Scheme. I think that's a pretty practical application, and good evidence that Lisps that aren't Clojure are good choices, too.
- dkersten 11y agoI don't like the Java environment at all. Furthermore, the syntax choices baffle me: Having to specifically know when a form uses () or [] is just odd. The 'let' form stands out as a good example of Clojure's bad language design choices. There's also no tail-call optimization, one has to explicitly use a 'recur' form to approximate it. I'll stop here. Everything you've said in the above quoted text is a selling point for me, not a negative thing. I like having the java environment because it brings a lot to the table. I really like (let [...] ...) because it makes it visually obvious to me where the bindings are. I also like explicitly using recur because it makes intent obvious and lets the compiler complain if its not in a tail position.