Julia (programming language)
|Paradigm||Multi-paradigm: multiple dispatch (core), procedural, functional, meta, multistaged|
|Designed by||Jeff Bezanson, Alan Edelman, Stefan Karpinski, Viral B. Shah|
|Developer||Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors|
1.2.0 / 20 August 2019
1.3.0-rc2 / 12 September 2019 / 1.4.0-DEV with daily updates
|Typing discipline||Dynamic, nominative, parametric, optional|
|Implementation language||Julia, C, C++, Scheme, LLVM|
|Platform||Tier 1: x86-64, IA-32, CUDA|
Tier 2: ARM (both 32- and 64-bit) and Tier 3: PowerPC
|OS||Linux, macOS, Windows and FreeBSD|
|License||MIT (core), GPL v2; a makefile option omits GPL libraries|
Julia is a high-level programming language designed for high-performance numerical analysis and computational science. Distinctive aspects of Julia's design include a type system with parametric polymorphism, a fully dynamic programming language, and multiple dispatch as its core programming paradigm. It allows concurrent, parallel and distributed computing, and direct calling of C and Fortran libraries without glue code. A just-in-time compiler that is referred to as "just-ahead-of-time" in the Julia community is used.
Julia is garbage-collected, uses eager evaluation, and includes efficient libraries for floating-point calculations, linear algebra, random number generation, and regular expression matching. Many libraries are available, including some (e.g., for fast Fourier transforms) that were previously bundled with Julia and are now separate.
Work on Julia was started in 2009, by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman, who set out to create a free language that was both high-level and fast. On 14 February 2012 the team launched a website with a blog post explaining the language's mission. In an interview with InfoWorld in April 2012, Karpinski said of the name "Julia": "There's no good reason, really. It just seemed like a pretty name." Bezanson said he chose the name on the recommendation of a friend.
Since the 2012 launch, the Julia community has grown, with over 10,000,000 downloads from as of September 2019[update] (and is used at more than 1,500 universities), The Official Julia Docker images, at Docker Hub, have seen over 4,000,000 downloads as of January 2019. The JuliaCon academic conference for Julia users and developers has been held annually since 2014.
Version 0.3 was released in August 2014, version 0.4 in October 2015, and version 0.5 in October 2016. Julia 0.6 was released in June 2017, and was the stable release version until 8 August 2018. Both Julia 0.7 (a useful release for testing packages, and for knowing how to upgrade them for 1.0) and version 1.0 were released on 8 August 2018. Work on Julia 0.7 was a "huge undertaking" (e.g., because of "entirely new optimizer"), and some changes were made to the syntax (with the syntax now stable, and same for 1.x and 0.7) and semantics; the iteration interface was simplified.
Most packages that work in Julia 1.0.x also work in 1.1.x or newer, enabled by the forward compatible syntax guarantee. The major exception is, for interacting with non-Julia code, the JavaCall.jl package (however calling other languages, e.g. R language works, with the package for R fixed) to call Java, Scala etc. So to use those languages with Julia, and e.g. JDBC.jl or Apache Spark (through Spark.jl), users can choose to stay with the LTS version of Julia for now, as a milestone is set for a fix in Julia 1.4 (however there's already a workaround for Julia-1.3.0-rc1) which has a due date for 12 December 2019. Julia 1.3 and 2.0 (and later) currently have no set due dates.
Julia has attracted some high-profile users, from investment manager BlackRock, which uses it for time-series analytics, to the British insurer Aviva, which uses it for risk calculations. In 2015, the Federal Reserve Bank of New York used Julia to make models of the US economy, noting that the language made model estimation "about 10 times faster" than its previous MATLAB implementation. Julia's co-founders established Julia Computing in 2015 to provide paid support, training, and consulting services to clients, though Julia itself remains free to use. At the 2017 JuliaCon conference, Jeffrey Regier, Keno Fischer and others announced that the Celeste project used Julia to achieve "peak performance of 1.54 petaFLOPS using 1.3 million threads" on 9300 Knights Landing (KNL) nodes of the Cori II (Cray XC40) supercomputer (then 6th fastest computer in the world; at its peak the supercomputer was 5th fastest, and while still on the TOP500 list, it's no longer one of the top 10). Julia thus joins C, C++, and Fortran as high-level languages in which petaFLOPS computations have been achieved.
Three of the Julia co-creators are the recipients of the 2019 James H. Wilkinson Prize for Numerical Software (awarded every four years) "for the creation of Julia, an innovative environment for the creation of high-performance tools that enable the analysis and solution of computational science problems."
Julia has received contributions from 800 developers worldwide. Dr. Jeremy Kepner at MIT Lincoln Laboratory was the founding sponsor of the Julia project in its early days. In addition, funds from the Gordon and Betty Moore Foundation, the Alfred P. Sloan Foundation, Intel, and agencies such as NSF, DARPA, NIH, NASA, and FAA have been essential to the development of Julia.
Though designed for numerical computing, Julia is a general-purpose programming language. It is also useful for low-level systems programming, as a specification language, and for web programming: both for server web use and for web client programming.
According to the official website, the main features of the language are:
- Multiple dispatch: providing ability to define function behavior across many combinations of argument types
- Dynamic type system: types for documentation, optimization, and dispatch
- Good performance, approaching that of statically-typed languages like C
- A built-in package manager
- Lisp-like macros and other metaprogramming facilities
- Call Python functions: use the PyCall package[b]
- Call C functions directly: no wrappers or special APIs
- Powerful shell-like abilities to manage other processes
- Designed for parallel and distributed computing
- Coroutines: lightweight green threading
- User-defined types are as fast and compact as built-ins
- Automatic generation of efficient, specialized code for different argument types
- Elegant and extensible conversions and promotions for numeric and other types
- Efficient support for Unicode, including but not limited to UTF-8
Multiple dispatch (also termed multimethods in Lisp) is a generalization of single dispatch – the polymorphic mechanism used in common object-oriented programming (OOP) languages – that uses inheritance. In Julia, all concrete types are subtypes of abstract types, directly or indirectly subtypes of the Any type, which is the top of the type hierarchy. Concrete types can not themselves be subtyped the way they can in other languages; composition is used instead (see also inheritance vs subtyping).
Julia draws significant inspiration from various dialects of Lisp, including Scheme and Common Lisp, and it shares many features with Dylan, also a multiple-dispatch-oriented dynamic language (which features an ALGOL-like free-form infix syntax rather than a Lisp-like prefix syntax, while in Julia "everything" is an expression), and with Fortress, another numerical programming language (which features multiple dispatch and a sophisticated parametric type system). While Common Lisp Object System (CLOS) adds multiple dispatch to Common Lisp, not all functions are generic functions.
In Julia, Dylan, and Fortress extensibility is the default, and the system's built-in functions are all generic and extensible. In Dylan, multiple dispatch is as fundamental as it is in Julia: all user-defined functions and even basic built-in operations like
+ are generic. Dylan's type system, however, does not fully support parametric types, which are more typical of the ML lineage of languages. By default, CLOS does not allow for dispatch on Common Lisp's parametric types; such extended dispatch semantics can only be added as an extension through the CLOS Metaobject Protocol. By convergent design, Fortress also features multiple dispatch on parametric types; unlike Julia, however, Fortress is statically rather than dynamically typed, with separate compiling and executing phases. The language features are summarized in the following table:
|Language||Type system||Generic functions||Parametric types|
|Common Lisp||Dynamic||Opt-in||Yes (but no dispatch)|
|Dylan||Dynamic||Default||Partial (no dispatch)|
By default, the Julia runtime must be pre-installed as user-provided source code is run. Alternatively, a standalone executable that needs no Julia source code can be built with ApplicationBuilder.jl and PackageCompiler.jl.
Julia's syntactic macros (used for metaprogramming), like Lisp macros, are more powerful and different from text-substitution macros used in the preprocessor of some other languages such as C, because they work at the level of abstract syntax trees (ASTs). Julia's macro system is hygienic, but also supports deliberate capture when desired (like for anaphoric macros) using the
The Julia official distribution includes an interactive session shell, called Julia's read–eval–print loop (REPL), which can be used to experiment and test code quickly. The following fragment represents a sample session example where strings are concatenated automatically by println:
julia> p(x) = 2x^2 + 1; f(x, y) = 1 + 2p(x)y julia> println("Hello world!", " I'm on cloud ", f(0, 4), " as Julia supports recognizable syntax!") Hello world! I'm on cloud 9 as Julia supports recognizable syntax!
The REPL gives user access to the system shell and to help mode, by pressing
? after the prompt (preceding each command), respectively. It also keeps the history of commands, including between sessions. Code that can be tested inside the Julia's interactive section or saved into a file with a
.jl extension and run from the command line by typing:
$ julia <filename>
Use with other languages
Julia is in practice interoperable with many languages. Julia's
ccall keyword is used to call C-exported or Fortran shared library functions individually.
Julia has Unicode 12.0 support (and latest 12.1.0 support, which adds only one letter, in Julia 1.3), with UTF-8 used for strings (by default) and for Julia source code, meaning also allowing as an option common math symbols for many operators, such as ∈ for the
Julia's core is implemented in Julia and C, together with C++ for the LLVM dependency. The parsing and code-lowering are implemented in FemtoLisp, a Scheme dialect. The LLVM compiler infrastructure project is used as the back end for generation of 64-bit or 32-bit optimized machine code depending on the platform Julia runs on. With some exceptions (e.g., PCRE), the standard library is implemented in Julia itself. The most notable aspect of Julia's implementation is its speed, which is often within a factor of two relative to fully optimized C code (and thus often an order of magnitude faster than Python or R). Development of Julia began in 2009 and an open-source version was publicized in February 2012.
Current and future platforms
While Julia uses JIT (MCJIT from LLVM) – Julia generates native machine code directly, before a function is first run (not bytecodes that are run on a virtual machine (VM) or translated as the bytecode is running, as with, e.g., Java; the JVM or Dalvik in Android).
Julia has four support tiers, and currently supports all x86-64 processors, that are 64-bit (and is more optimized for the latest generations) and all IA-32 ("x86") processors except for decades old ones, i.e., in 32-bit mode ("i686", excepting CPUs from the pre-Pentium 4-era); and supports more in lower tiers, e.g., tier 2: "fully supports ARMv8 (AArch64) processors, and supports ARMv7 and ARMv6 (AArch32) with some caveats." CUDA (i.e. "Nvidia PTX") has tier 1 support, with the help of an external package.
- [With Rebugger.jl] you can:
- test different modifications to the code or arguments as many times as you want; you are never forced to exit “debug mode” and save your file
- run the same chosen block of code repeatedly (perhaps trying out different ways of fixing a bug) without needing to repeat any of the “setup” work that might have been necessary to get to some deeply nested method in the original call stack.
- For calling the newer Python 3 (the older default to call Python 2, is also still supported) and calling in the other direction, from Python to Julia, is also supported with pyjulia.
- "Smoothing data with Julia's @generated functions". 5 November 2015. Retrieved 9 December 2015.
Julia's generated functions are closely related to the multistaged programming (MSP) paradigm popularized by Taha and Sheard, which generalizes the compile time/run time stages of program execution by allowing for multiple stages of delayed code execution.
- "LICENSE.md". GitHub.
- "Contributors to JuliaLang/julia". GitHub.
- "Why We Created Julia". Julia website. February 2012. Retrieved 7 February 2013.
- "v1.2.0". Github.com. 20 August 2019. Retrieved 20 August 2019.
- "v1.3.0-rc2". GitHub. Retrieved 13 September 2019.
- "Julia". Julia. NumFocus project. Retrieved 9 December 2016.
Julia's Base library, largely written in Julia itself, also integrates mature, best-of-breed open source C and Fortran libraries for ...
- Fischer, Keno (22 July 2019). "Running julia on wasm". Retrieved 25 July 2019.
- "Non-GPL Julia?". Groups.google.com. Retrieved 31 May 2017.
- "Introduce USE_GPL_LIBS Makefile flag to build Julia without GPL libraries".
Note that this commit does not remove GPL utilities such as git and busybox that are included in the Julia binary installers on Mac and Windows. It allows building from source with no GPL library dependencies.
- "Home · The Julia Language". docs.julialang.org. Retrieved 15 August 2018.
- "Programming Language Network". GitHub. Retrieved 6 December 2016.
- "JuliaCon 2016". JuliaCon. Retrieved 6 December 2016.
He has co-designed the programming language Scheme, which has greatly influenced the design of Julia
- Bryant, Avi (15 October 2012). "Matlab, R, and Julia: Languages for data analysis". O'Reilly Strata. Archived from the original on 26 April 2014.
- Singh, Vicky (23 August 2015). "Julia Programming Language – A True Python Alternative". Technotification.
- Krill, Paul (18 April 2012). "New Julia language seeks to be the C for scientists". InfoWorld.
- Finley, Klint (3 February 2014). "Out in the Open: Man Creates One Programming Language to Rule Them All". Wired.
- Fischer, Keno; Nash, Jameson. "Growing a Compiler - Getting to Machine Learning from a General Purpose Compiler". Julia Computing Blog. Retrieved 11 April 2019.
- "Suspending Garbage Collection for Performance...good idea or bad idea?". Groups.google.com. Retrieved 31 May 2017.
- (now available with
using FFTWin current versions; that dependency is one of many moved out of the standard library to a package because it is GPL licensed, and thus is not included in Julia 1.0 by default.) "Remove the FFTW bindings from Base by ararslan · Pull Request #21956 · JuliaLang/julia". GitHub. Retrieved 1 March 2018.
- "ANN: linter-julia plugin for Atom / Juno". JuliaLang. 15 February 2017. Retrieved 10 April 2019.
- "A Julia interpreter and debugger". julialang.org. Retrieved 10 April 2019.
- "[ANN] Rebugger: interactive debugging for Julia 0.7/1.0". JuliaLang. 21 August 2018. Retrieved 10 April 2019.
- "Home · Rebugger.jl". timholy.github.io. Retrieved 10 April 2019.
- Jeff Bezanson, Stefan Karpinski, Viral Shah, Alan Edelman. "Why We Created Julia". JuliaLang.org. Retrieved 5 June 2017.CS1 maint: multiple names: authors list (link)
- Stefan Karpinski, New Julia language seeks to be the C for scientists, InfoWorld, 18 April 2012
- Torre, Charles. "Stefan Karpinski and Jeff Bezanson on Julia". Channel 9. MSDN. Retrieved 4 December 2018.
- "Newsletter August 2019". juliacomputing.com. Retrieved 20 August 2019.
- "Newsletter June 2019". juliacomputing.com. 11 June 2019. Retrieved 20 August 2019.
- "Julia Computing Newsletter, Growth Metrics". juliacomputing.com. Retrieved 11 February 2019.
- "Newsletter January 2019". juliacomputing.com. 4 January 2019. Retrieved 20 August 2019.
- "JuliaCon website". juliacon.org. Retrieved 10 May 2018.
- The Julia Blog
- "What is Julia 0.7? How does it relate to 1.0?". JuliaLang. Retrieved 17 October 2018.
- Eric Davies. "Writing Iterators in Julia 0.7". julialang.org. Retrieved 5 August 2018.CS1 maint: uses authors parameter (link)
- "Sys.isjsvm([os])". The Julia Language. 20 August 2019. Retrieved 20 August 2019.
- "Julia Computing". juliacomputing.com. Retrieved 15 September 2019.
- "Fix for C stack checking issues on 1.1 by simonbyrne · Pull Request #293 · JuliaInterop/RCall.jl". GitHub. Retrieved 10 August 2019.
- "JVM fails to load in 1.1 (JavaCall.jl) · Issue #31104 · JuliaLang/julia". GitHub. Retrieved 18 August 2019.
JeffBezanson modified the milestones: 1.3, 1.4
- "add environment variable `JULIA_ALWAYS_COPY_STACKS` (#32885) · JuliaLang/julia@ae4e08c". GitHub. Retrieved 18 August 2019.
- Milestones - JuliaLang/julia, The Julia Language, 15 September 2019, retrieved 15 September 2019
- "JuliaCon 2017". juliacon.org. Retrieved 4 June 2017.
- Fisher, Keno. "The Celeste Project". juliacon.org. Retrieved 24 June 2017.
- Regier, Jeffrey; Pamnany, Kiran; Giordano, Ryan; Thomas, Rollin; Schlegel, David; McAulife, Jon; Prabat (2016). "Learning an Astronomical Catalog of the Visible Universe through Scalable Bayesian Inference". arXiv:1611.03404 [cs.DC].
- Claster, Andrew (12 September 2017). "Julia Joins Petaflop Club". Julia Computing (Press release).
Celeste is written entirely in Julia, and the Celeste team loaded an aggregate of 178 terabytes of image data to produce the most accurate catalog of 188 million astronomical objects in just 14.6 minutes [..] a performance improvement of 1,000x in single-threaded execution.
- Shah, Viral B. (15 November 2017). ". @KenoFischer is speaking on Celeste in the @Intel theatre at @Supercomputing. 0.65M cores, 56 TB of data, Cori - world's 6th largest supecomputer.pic.twitter.com/21nLHo1qty". @Viral_B_Shah. Retrieved 15 September 2019.
- "Julia language co-creators win James H. Wilkinson Prize for Numerical Software". MIT News. Retrieved 22 January 2019.
- "The Julia Language: A fresh approach to technical computing.: JuliaLang/julia". The Julia Language. 26 January 2019. Retrieved 26 January 2019.
- "Julia Sponsors, Research, and Publications".
- "About Us – Julia Computing". juliacomputing.com. Retrieved 12 September 2017.
- "The Julia Language" (official website).
General Purpose [..] Julia lets you write UIs, statically compile your code, or even deploy it on a webserver.
- Green, Todd (10 August 2018). "Low-Level Systems Programming in High-Level Julia". Archived from the original on 5 November 2018. Retrieved 5 November 2018.
- Moss, Robert (26 June 2015). "Using Julia as a Specification Language for the Next-Generation Airborne Collision Avoidance System". Archived from the original on 1 July 2015. Retrieved 29 June 2015.
- Anaya, Richard (28 April 2019). "How to create a multi-threaded HTTP server in Julia". Medium. Retrieved 25 July 2019.
In summary, even though Julia lacks a multi-threaded server solution currently out of box, we can easily take advantage of its process distribution features and a highly popular load balancing tech to get full CPU utilization for HTTP handling.
- Anthoff, David (1 June 2019). "Node.js installation for julia". Retrieved 25 July 2019.
- "PyCall.jl". stevengj. github.com.
- "Using PyCall in julia on Ubuntu with python3". julia-users at Google Groups.
to import modules (e.g., python3-numpy)
- "python interface to julia".
- "Learn Julia in Y Minutes". Learnxinyminutes.com. Retrieved 31 May 2017.
- Daly, Nathan (13 February 2019). "Compile, bundle, and release julia software. Contribute to NHDaly/ApplicationBuilder.jl development by creating an account on GitHub". Retrieved 15 February 2019.
- "Compile your Julia Package. Contribute to JuliaLang/PackageCompiler.jl development by creating an account on GitHub". The Julia Language. 14 February 2019. Retrieved 15 February 2019.
- "Getting Started · The Julia Language". docs.julialang.org. Retrieved 15 August 2018.
- See also: https://docs.julialang.org/en/v1/manual/strings/ for string interpolation and the
string(greet, ", ", whom, ".\n")example for preferred ways to concatenate strings. Julia has the println and print functions, but also a @printf macro (i.e., not in function form) to eliminate run-time overhead of formatting (unlike the same function in C).
- "Julia Documentation". JuliaLang.org. Retrieved 18 November 2014.
- "Project Jupyter".
- "support for Unicode 12.1.0 by stevengj · Pull Request #32002 · JuliaLang/julia". GitHub. Retrieved 12 May 2019.
- JeffBezanson (6 June 2019). "JeffBezanson/femtolisp". GitHub. Retrieved 16 June 2019.
- "Julia: A Fast Dynamic Language for Technical Computing" (PDF). 2012.
- "How To Make Python Run As Fast As Julia". 2015.
- "Basic Comparison of Python, Julia, R, Matlab and IDL". 2015.
- Gibbs, Mark (9 January 2013). "Pure and Julia are cool languages worth checking out". Network World (column). Retrieved 7 February 2013.
- "Support MCJIT". Github.com. Retrieved 26 May 2015.
- "Using MCJIT with the Kaleidoscope Tutorial". 22 July 2013. Retrieved 26 May 2015.
The older implementation (llvm::JIT) is a sort of ad hoc implementation that brings together various pieces of the LLVM code generation and adds its own glue to get dynamically generated code into memory one function at a time. The newer implementation (llvm::MCJIT) is heavily based on the core MC library and emits complete object files into memory then prepares them for execution.
- "Julia Downloads". julialang.org. Retrieved 17 May 2019.
- "julia: The Julia Language: A fresh approach to technical computing". The Julia Language. 1 February 2018. Retrieved 1 February 2018.
A list of known issues for ARM is available.
- "Julia available in Raspbian on the Raspberry Pi".
Julia works on all the Pi variants, we recommend using the Pi 3.
- "Julia language for Raspberry Pi". Raspberry Pi Foundation.
|Wikibooks has a book on the topic of: Introducing Julia|