This is a short overview of several programming languages that I play with when I have some time.
I can remember that my very first programming language was Turbo Pascal; it was an introductory course taught to students enrolled in experimental psychology and the design of psychophysical experiments. Then, I used Matlab a lot during 3 to 4 years. It serves as a statistical package to analyse my data, but it was also a tool to construct visual stimuli and learn basic principles of image and signal processing. I even build a GUI for signal processing and data analysis. During my PhD, I started learning C and Java, while attending a lot of statistical courses. It was also the time I definitively switched to the R statistical package. I learned a little bit of Perl, and then discovered Python, which I mostly used like Bash until recently where I started to use it for some heavy computational statistical tasks.
Now, a lot of more or less “esoteric” languages has emerged, not that they are necessarily very new but since I’m not a true computer scientist I’m not always up to date. Among those languages that I wish I had time to learn more, there are: Ruby, Scala, Haskell, Lua, Clojure, and a lot of stuff around Lisp (clisp, Chicken, CMUCL, SBCL, Clozure CL, Lush).
The Scala programming language is “a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive.”
Something that I like is that there is a package manager, sbaz, which allows to install additional packages and update the current version of Scala. Also, the documentation sets is impressive. Look for instance at A Scala Tutorial for Java programmers to get a feel of it.
I discovered Haskell three or four years ago when reading Vincent Zoonekynd’s blog (here). I initially thought it was something to do fun things in mathematics, and never came back to it until recently when I came across this interesting paper on functional programming for information visualization and visual analytics: Beautiful Code, Compelling Evidence, by J. R. Heard. There is a nice illustration with annotated code on the use of circular displays based on OpenGL (that I also discussed in a preceding post).
Like for Ruby and its Rubiz Quiz, there is an Haskell Quiz for the interested hackers.
I’ve started to learn Clojure, because of the rise of Incanter in (part of) the statistical community.
R. Mark Volkmann did a good job at exposing the main ideas of Clojure in Clojure - Functional Programming for the JVM. On a related point, I also like From Lisp to Clojure/Incanter and R, by Shane Conway, because it offers a comparative view of Clojure and R approaches. A lot of other discussions may be found on Stack Overflow. Actually, I’m still in the process of learning the language.
A bunch of free ressources on Clojure:
There are actually two books that are worth to look at:
- Stuart Halloway, Programming Clojure, The Pragmatic Bookshelf, 2009 – with code available on Github
- Luke VanderHart and Stuart Sierra, Practical Clojure, Apress, 2010
As for dedicated libraries, I’d like mention the following ones for Machine Learning and data processing:
- Infer, by Bradford Cross
- Injuce, by Mark Reid (don’t know how this project will evolve, though)
Yet another dynamic programming language that targets the Java Virtual Machine. Following the online description, it is an agile and dynamic language for the Java Virtual Machine; it builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk; it seamlessly integrates with all existing Java classes and libraries; and it compiles straight to Java bytecode so you can use it anywhere you can use Java. I have no experience with it, though.
The famous “Hello World” example with groovy reads:
groovy -e "println 'Hello ' + args" World
Well, Lua is a lightweight programming language very useful for automating tasks and interacting with the oerating system. According to the documentation, it is robust, fast, portable, embeddable, and powerful yet remaining simple when implementing classes and inheritance. I initially came across this language through Context because the MkIV implementation relies on it, and more generally the LuaTeX engine (but see, e.g, ConTEXt MkIV: Going UTF, by Hans Hagen).
Some good tutorials to get started with Lua are listed below:
- The Lua Tutorial, which features an introduction to Lua scripting and a crash course in Lua programming
- Lua: for beginner, which offers a gentle introduction to programming with Lua
There is also an extensive documentation on Lua website, don’t miss it.
Pure is “a modern-style functional programming language based on term rewriting. It offers equational definitions with pattern matching, full symbolic rewriting capabilities, dynamic typing, eager and lazy evaluation, lexical closures, built-in list and matrix support and an easy-to-use C interface. The interpreter uses LLVM as a backend to JIT-compile Pure programs to fast native code.”
I didn’t success in compiling and installing Pure. It needs a recent version of LLVM compiler and it seems that the one that ships with OS X doesn’t do the job.