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.
I found an excellent game in the Humble Store a few days ago called Frozen Synapse. This game was released in 2011 but I never heard of it before.
“Frozen Synapse is a turn-based tactics video game developed by independent game developer Mode 7 Games, in which players plan their moves at their leisure and turns are resolved simultaneously. Players attempt to win by giving orders to a small squad of armed combatants, most commonly with the goal of eliminating all enemy units.” (via wikipedia)
Here is the trailer:
The design of the game is very similar to the games of Introversion Software (Uplink, Darwinia, Defcon). I guess the creators of this game are a huge fan of Introversion games :)
In theory it works under Linux too but I couldn’t make it run under my Ubuntu 13.10 yet. I had to try it under Windows.
Are you aware of similar games? If yes, please leave a comment.
“Shekhar Gulati took on the challenge of learning 30 new technologies in 30 days and blogging about each day. He hasn’t missed a day. His goal is to get familiar with many of the new technologies being used in the developer community and how each one can work on OpenShift. See the landing page of all the technologies he’s learned so far.” (from OpenShift newsletter, Nov. 2013)
Do you sit hours in front of your computer every day? Then very likely you have a bad posture. Here is how to improve it:
The Humble Store is a permanent addition to the Humble site that allows customers to buy great games at great prices 24/7 for PC, Mac, Linux and Android. The list of games is updated daily!
Today I bought for instance Euro Truck Simulator 2 for $6.25. Good bargain :)