I wrote my first “Hello World” program in Clojure :) Here I sum up what I managed to figure out.
Learning a new language, especially a new programming paradigm is always useful. I’ve been interested in functional programming for a long time but I could never find time to dive into it. Once I started to learn Haskell but at Chapter 2 I gave up. Maybe once… However, I heard very good things about Clojure, so I would like to investigate it from a closer range. I also like the idea that it’s built upon the JVM.
Mark Volkmann wrote an excellent introduction to the language, it’s a very good starting point.
Clojure is built upon the JVM. The good news is that you don’t need to download different JAR files and put them to the classpath. There is an excellent command-line tool called Leiningen (“
lein” for short) that does this job for you. Steps to follow:
- download the lein script
- put it in your PATH (I put it to
- make it executable (
chmod u+x lein)
- launch it (it will download the necessary files)
Create a new project:
lein new app hello
Lein will make the folder “
hello” and it will create a simple project structure.
Open the file
src/hello/core.clj and edit the last line:
... (println "Hello Clojure!"))
Enter the project “
hello” (the folder where the file
project.clj is placed) and run the project:
Normally you should see the “
Hello Clojure!” output. Starting the JVM is expensive, the runtime of this simple basic script is more than 4 seconds on my laptop. But I’m pretty sure that once the JVM is loaded, it’s fast.
Just for fun: Cobol tutorial.
To be clear, I don’t ever want to touch Cobol. This is just for the record :)
“Most of you have noticed that programming language names tend to fall in several different themes. Here is an attempt to catalogue them.“
Some quotes from Wikipedia:
“Haskell is a standardized, general-purpose purely functional programming language…“
“The language continues to evolve rapidly, with the Glasgow Haskell Compiler (GHC) implementation representing the current de facto standard.“
“It is a purely functional language, which means that in general, functions in Haskell do not have side effects.“
“There is an active community around the language, and more than 2600 third-party open-source libraries and tools are available in the online package repository Hackage.“
sudo apt-get install haskell-platform
Hello, World! (compiled)
Create the file
main = putStrLn "Hello, World!"
ghc hello.hs -o hello
Run it with
Hello, World! (interpreted)
#!/usr/bin/runghc main = putStrLn "Hello, World!"
chmod u+x hello.hs” and “
There are tons of tutorials on the Web.
- bitemyapp/learnhaskell (a recommended path for learning Haskell)
- Learn You a Haskell for Great Good! by Miran Lipovača is a fun introduction to the language. Get the PDF version here.
- Haskell in 5 steps (quick intro)
“For the past few years, Computerworld Australia has undertaken a series of investigations into interesting programming languages and the people that use them. We have spoken to numerous interesting characters about why they created the language, the progress it has made in the developer world, and what achievements they are most proud of.“
For the list, check out this link. You will find lots of interesting interviews with the creators of the languages.
If you plan to start learning a new programming language but don’t know yet which one to choose, have a look at http://langpop.com. They attempt to collect a variety of data about the relative popularity of programming languages.
A similar site is the TIOBE Index.