Julia: A Fast Dynamic Language for Technical Computing

Jeff Bezanson,Stefan Karpinski,Viral B. Shah,Alan Edelman
DOI: https://doi.org/10.48550/arXiv.1209.5145
2012-09-24
Abstract:Dynamic languages have become popular for scientific computing. They are generally considered highly productive, but lacking in performance. This paper presents Julia, a new dynamic language for technical computing, designed for performance from the beginning by adapting and extending modern programming language techniques. A design based on generic functions and a rich type system simultaneously enables an expressive programming model and successful type inference, leading to good performance for a wide range of programs. This makes it possible for much of the Julia library to be written in Julia itself, while also incorporating best-of-breed C and Fortran libraries.
Programming Languages,Computational Engineering, Finance, and Science
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is the performance issue of dynamic languages in scientific computing. Specifically, although dynamic languages (such as MATLAB, Octave, R, SciPy, and SciLab) are popular for their high productivity, they are generally considered to lack sufficient performance to handle computationally - intensive tasks. Therefore, these tasks often need to be completed using statically - compiled languages such as C or Fortran, which has led to the emergence of a "two - layer architecture", that is, high - level logic is implemented in dynamic languages, while the core computing part is written in C or Fortran. The paper proposes the Julia language as a solution to this problem. Julia is a new dynamic language specifically designed for technical computing and has focused on performance from the very beginning. By adopting modern programming language techniques, Julia can provide performance close to that of statically - compiled languages without sacrificing the flexibility and productivity of dynamic languages. Its main features include: 1. **Rich type system**: Julia provides rich type information, which is naturally provided by the multiple dispatch mechanism. 2. **Code specialization**: Julia can aggressively specialize code according to runtime types, thereby improving performance. 3. **Just - In - Time (JIT) compilation**: Julia uses the LLVM compilation framework for just - in - time compilation to further improve performance. Through these designs, Julia can not only provide high performance but also maintain the interactivity and productivity of dynamic languages. In addition, most of Julia's standard library is written in Julia itself, which makes the library code more general, more compact, and can be inlined in user code. These features give Julia significant advantages in the field of scientific computing.