Introduction to Julia
what, when, why, how
This draft covers the history of Julia, it’s strengths & weaknesses.
This is part 1 of the Julia Tutorials (a series of tutorials on Julia).
Feel free to check out the complete series @ —
What is Julia?
Julia is a free, open-source language that is extremely easy to use. This allows researchers with low technical expertise to easily create and share programs that others will be able to use for free and improve upon. Julia uses multiple dispatch as a paradigm, making it easy to express many object-oriented and functional programming patterns. It provides asynchronous I/O, debugging, logging, profiling, a package manager, and more. Julia also uses the JIT (Just in Time) — compiler which generates native machine code. The JIT compiler provides stability via multiple dispatches, which makes it easy to compile the code to an efficient one. Julia supports multiple tools, editors (Vim, Emacs, etc) as well as IDEs (Juno, Microsoft Visual Studio, etc).
While it is a general-purpose language and can be used to write any application, many of its features are well-suited for numerical analysis and computational science. Among Julia’s many claims to fame include its membership in the “petaflop club” which was achieved by a Julia application called Celeste. The Celeste team achieved peak performance of 1.54 petaflops using 1.3 million threads on 9,300 Knights Landing (KNL) nodes of the Cori supercomputer at NERSC.
When did Julia happen?
Work on Julia was started in 2009 by MIT researchers Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman. Julia was envisioned as an open-source (i.e., free) computing language that was both fast and worked at a high level. In 2012, the computer language made its debut to the public and has since climbed up the ranks as one of the world’s most popular programming languages, to the point that many programmers now see it as a potential rival to Python, a stalwart language.
The idea of Julia was born when it’s creators realized that though computationally expensive tasks like scientific and numerical computing required high performance, domain experts usually went with slower, more dynamic languages for daily programming. While Julia’s creators understood the reasons for programmers to prefer dynamic languages for certain applications, they were still determined in leveraging modern language design and compiler techniques for a single environment that’s powerful enough for prototyping but also had the efficiency for performance-intensive applications.
Here’s the idea behind Julia in the words of it’s creators,
We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled. It should be as fast as C. Read more…
How Julia achieved those aspirations?
- Julia has multiple dispatch. One of the most powerful aspects of Julia is its multiple dispatch paradigm which proved to be one of the most polymorphic, extensible, and composable type systems out there.
- Julia is compiled, not interpreted. For faster runtime performance, Julia is just-in-time (JIT) compiled using the LLVM compiler framework. At its best, Julia can approach or match the speed of C.
- Julia is interactive. Julia includes a REPL (read-eval-print loop), or interactive command line, similar to what Python offers. Quick one-off scripts and commands can be punched right in.
- Julia has a straightforward syntax. Julia’s syntax is similar to Python’s — terse, but also expressive and powerful.
- Julia combines the benefits of dynamic typing and static typing.
- Julia has foreign function interfaces. Julia can interface directly with external libraries written in C/Fortran, C++, Python, R, Java, and many other languages.
- Julia supports metaprogramming. Julia programs can generate other Julia programs, and even modify their own code, in a way that is reminiscent of languages like Lisp.
Some downsides of Julia
- Compiler latency: Compiler latency has been one of the high priority issues in Julia. It is a lot slower when compared to other languages like Python(~27x slower) or C( ~187x slower).
- Static compilation support: Of Course, Julia can be compiled. Unlike the language C which is compiled before execution, Julia is compiled at runtime. Thus Julia provides poor support for static compilation.
- Array optimizations: To get good performance, Julia users have to use manually in-place operations to get high performance array code.
- Incomplete notations: Many codes in Julia have incomplete notations. For eg. N-d array
Next Up — Julia Environment Setup