Julia is a new, open source, mathematical programming language.

At Strata, Michael Bean of Forio Simulations presented a talk about the language. This was one of the most exciting talks at Strata. It’s a dynamic language that is great for data analysis and exploration. I was typing as fast as I could during the talk but managed to get these ideas down and then follow up with the slides after the conference

  • Dynamic
  • List comprehension
  • Array comprehension (initialize and populate in a single pass)
  • Uses machine arithmetic
  • Can easily specify precision (in Julia, try .3/.1, and then try it with float32(.3/.1))
  • Linear programming packages
  • All packages are on Git

A trade-off in technical programming languages is between the use of dynamic environments for exploration and research, and slow performance. In their explanation of why they created Julia, the founders explain that they wanted more than one language in each of several different areas that is especially strong in that area, but is weak in other areas. They were greedy and wanted more, they wanted a language that could be good at a number of different tasks.

Michael used the Fibonacci number in his talk. If the Strata talk turn out to be a seminal, evangelical moment for Julia, then calculating the Fibonacci number is going to be the canonical example of Julia’s performance advantage over R. (The Julia language homepage compares benchmark results for several language.) Michael used the example because it includes two recursive calls. There are better algorithms, but it shows the comparative performance advantages over R.

Included here are the two code samples from his talk. (Edit: Code samples posted at gist 8995167):

Using a call of fib(40), the elapsed time in Julia is 1.0763370990753174 seconds. I had to cancel the same call in R and rerun it using a value of n that would calculate. With n of 35, the time in R was 40.309 seconds. To make sure the function I wrote was accurate and both functions returned the same value, I reran the call in Julia using n = 35. The elapsed time was 0.09497690200805664 seconds.

When you start up Julia in a shell, the banner says A fresh approach to technical computing. R has all the packages going for it, but with Julia, programmers and scientists have a mathematical computing language that supports parallel, distributed computing, is fast, provides the glue, and seems pretty easy to learn. Julia is something to watch.  Download it and give it a try.