Taming the Parentheses - Get Started With Clojure13 Oct 2016
is valid Python 3 while Clojure has
(println "hello world")
Clojure now goes one step further and applies the same principle to almost anything like e.g. function declaration:
(defn fun [param] "result")
To get a better sense if Clojure is for you, I suggest watching the excellent talk Clojure, made simple by the language creator Rich Hickey.
At my company I’ve held a Clojure talk recently too and tried to give an overview of the language and present its applications in web development. Of course without a video you miss out on the demos but it might be worth to skip through quickly anyway: Clojure - The Average Joe’s Lisp.
My goal was to show that Clojure is far from the stereotype of an academic esoteric language and can be learned easily to elegantly solve real-world problems.
If you want to dive right in and write code, try the online interpreter (or REPL) tryclj.com or solve one of the easy beginner problems like finding the greatest common divisor with another interactive site 4clojure.com (you can also pick an easier one like this). In a similar vein the katas from codewars.com helped me get into the language (and become fluent in it).
When you’re ready to write some larger programs of your own I suggest you install a JDK and then the basic build tool Leinigen. Here’s how to do it on unixy OSs (go to the website for Windows instructions):
$ wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein # move if in a dir on your $PATH, like ~/bin $ mv lein ~/bin # make it executable $ chmod a+x ~/bin/lein # run it once to self-install $ lein
As a starting point for web development I suggest the Luminus micro-framework which packs the best web libraries in one nice template a bit like JHipster generates a nice Spring Boot + AngularJS project. Just type this in a terminal:
$ lein new luminus my-app $ cd my-app $ lein run Started server on port 3000
Although I’m skeptical of large frameworks the Arachne is made by very knowledgeable web developers and will hopefully come out soon and not turn web development into plumbing of some magical components.
If you come this far, take a look at some of the excellent books on Clojure: