Paradigm | Multi-paradigm: multiple dispatch (primary paradigm), procedural, functional, meta, multistaged[1] |
---|---|
Designed by | Jeff Bezanson, Alan Edelman, Stefan Karpinski, Viral B. Shah |
Developer | Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors[2][3] |
First appeared | 2012[4] |
Stable release | |
Preview release | |
Typing discipline | Dynamic,[18] strong,[18] nominative, parametric, optional |
Implementation language | Julia, C, C++, Scheme, LLVM[19] |
Platform | Tier 1: x86-64, IA-32; CUDA 10.1+[20]/Nvidia GPUs (for Linux and Windows) Tier 2: 64-bit ARM, 32-bit Windows (64-bit is tier 1) Tier 3: 32-bit ARM, PowerPC, AMD (ROCm) GPUs. Also supports oneAPI/Intel's GPUs and Google's TPUs,[21] and has web browser support (for JavaScript and WebAssembly),[22] and can work in Android. For more details see "supported platforms". |
OS | Linux, macOS, Windows and FreeBSD |
License | MIT (core),[2] GPL v2;[23][24] a makefile option omits GPL libraries[25] |
Filename extensions | .jl |
Website | JuliaLang.org |
Influenced by | |
Julia is a high-level, high-performance, dynamic programming language. 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.[31][32][33][34]
Distinctive aspects of Julia's design include a type system with parametric polymorphism in a dynamic programming language; with multiple dispatch as its core programming paradigm. Julia supports concurrent, (composable) parallel and distributed computing (with or without using MPI[35] or the built-in corresponding[clarification needed][36] to "OpenMP-style" threads[37]), and direct calling of C and Fortran libraries without glue code. Julia uses a just-in-time (JIT) compiler that is referred to as "just-ahead-of-time" (JAOT) in the Julia community, as Julia compiles all code (by default) to machine code before running it.[38][39]
Julia is garbage-collected,[40] 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.[41]
Several development tools support coding in Julia, such as integrated development environments (e.g. Microsoft's Visual Studio Code, with extensions available adding Julia support to IDEs, e.g. providing debugging and linting[42] support); with integrated tools, e.g. a profiler (and flame graph support available[43][44] for the built-in one), debugger,[45] and the Rebugger.jl package "supports repeated-execution debugging"[a] and more.[47]
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.[48] 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."[33] Bezanson said he chose the name on the recommendation of a friend,[49] then years later wrote:
Maybe julia stands for “Jeff’s uncommon lisp is automated”?[50]
Since the 2012 launch, the Julia community has grown, and as of 2020 "Julia has been downloaded by users at more than 10,000 companies and is used at more than 1,500 universities"[51] with over 35 million downloads as of January 2022[update],[52][53] and the Julia package ecosystem has over 11.8 million lines of code (including docs and tests).[54] The JuliaCon academic conference for Julia users and developers has been held annually since 2014 with JuliaCon2020 welcoming over 28,900 unique viewers,[55] and then JuliaCon2021 breaking all previous records (with more than 300 JuliaCon2021 presentations available for free on YouTube, up from 162 the year before), and 43,000 unique viewers during the conference.[56]
Version 0.3 was released in August 2014, version 0.6 in June 2017.[57] Both Julia 0.7[58] and version 1.0 were released on 8 August 2018. Work on Julia 0.7 was a "huge undertaking" (e.g., because of an "entirely new optimizer"), and some changes were made to semantics, e.g. the iteration interface was simplified;[59] and the syntax changed a little (with the syntax now stable, and same for 1.x and 0.7).
Julia 1.1 was released in January 2019 with a new "exception stack" feature. Julia 1.2 was released in August 2019 with some built-in support for web browsers .[60] Julia 1.3 added composable multi-threaded parallelism and a binary artifacts system for Julia packages.[61]
Julia 1.4 added syntax for generic array indexing to handle 0-based arrays.[62] The memory model was also changed.[63]
Julia 1.5 released in August 2020 added record and replay debugging support,[64] for Mozilla's rr tool. The release changed the behavior in the REPL (soft scope) to the one used in Jupyter, but fully compatible with non-REPL code. Most of the thread API was marked as stable, and with this release "arbitrary immutable objects—regardless of whether they have fields that reference mutable objects or not—can now be stack allocated",[65] reducing heap allocations, e.g. views
are no longer allocating. Julia 1.5 targeted so-called "time-to-first-plot" performance, in general, the speed of compilation itself (as opposed to performance of the generated code), and adds tools for developers to improve package loading.[66]
Julia 1.6 was the largest release since 1.0, faster on many fronts, e.g. introduced parallel precompilation and faster loading of packages, in some cases "50x speedup in load times for large trees of binary artifacts".[67]
As of version 1.7 Julia development is back to time-based releases.[68]
Julia 1.7.0 was released in November 2021, with many changes, e.g. a new faster random-number generator.
Julia 1.8 is out as a beta version (with improvements regarding distributing Julia programs without source code, and compiler speedup, in some cases by 25%[69] and more controllable inlining, e.g. at the function call site) and Julia 1.9 is the next milestone, it and the milestone for 2.0 currently have no set due dates.[70][71]
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. Since 2015, the Federal Reserve Bank of New York has used Julia to make models of the United States economy (including estimating COVID-19 shocks in 2021[72]), noting that the language made model estimation "about 10 times faster" than its previous MATLAB implementation. At the 2017 JuliaCon[73] conference, Jeffrey Regier, Keno Fischer and others announced[74] that the Celeste project[75] used Julia to achieve "peak performance of 1.54 petaFLOPS using 1.3 million threads"[76] on 9300 Knights Landing (KNL) nodes of the Cori II (Cray XC40) supercomputer (then 6th fastest computer in the world).[77] 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."[78] Also, Alan Edelman, professor of applied mathematics at MIT, has been selected to receive the 2019 IEEE Computer Society Sidney Fernbach Award "for outstanding breakthroughs in high-performance computing, linear algebra, and computational science and for contributions to the Julia programming language."[79]
In 2019, Julia Computing announced "the availability of the Julia programming language as a pre-packaged container on the NVIDIA GPU Cloud (NGC) container registry"[80] and a blog post at Nvidia's site states "Easily Deploy Julia on x86 and Arm [..] Julia offers a package for a comprehensive HPC ecosystem covering machine learning, data science, various scientific domains and visualization."[81]
Additionally, "Julia was selected by the Climate Modeling Alliance as the sole implementation language for their next generation global climate model. This multi-million dollar project aims to build an earth-scale climate model providing insight into the effects and challenges of climate change."[80]
Julia is used by NASA, e.g. for modeling spacecraft separation dynamics (15,000 times faster than before with Simulink/MATLAB[82])[83][84][85] and the Brazilian INPE for space mission planning and satellite simulation.[86] Another effort is working on an embedded project to control a satellite in space using Julia for attitude control.[citation needed]
Since 2014,[87] the Julia Community has hosted an annual Julia Conference focused on developers and users. The first JuliaCon took place in Chicago and kickstarted the annual occurrence of the conference. Since 2014, the conference has taken place across a number of locations including MIT[88] and the University of Maryland, Baltimore.[89] The event audience has grown from a few dozen people to over 28,900 unique attendees[90] during JuliaCon 2020, which took place virtually. JuliaCon 2021 also took place virtually[91] with keynote addresses from professors William Kahan (the primary architect of the IEEE 754 floating-point standard, which his keynote is about, that virtually all CPUs use and languages, including Julia),[92] and Jan Vitek,[93] Xiaoye Sherry Li, and Soumith Chintala (co-creator of PyTorch).[94] JuliaCon grew to 43,000 unique attendees and more than 300 presentations (still freely accessible, plus for older years). JuliaCon 2022 will also be virtual held between July 27th and July 29th 2022, for the first time in several languages, not just in English.
The Julia language became a NumFOCUS fiscally sponsored project in 2014 in an effort to ensure the project's long-term sustainability.[95] 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.[96] Mozilla, the maker of Firefox web browser, with its research grants for H1 2019, sponsored "a member of the official Julia team" for the project "Bringing Julia to the Browser",[97] meaning to Firefox and other web browsers.[98][99][100][101] The Julia Language is also supported by individual donors on GitHub.[102]
Julia Computing, Inc. was founded in 2015 by Viral B. Shah, Deepak Vinchhi, Alan Edelman, Jeff Bezanson, Stefan Karpinski and Keno Fischer.[103]
In June 2017, Julia Computing raised US$4.6 million in seed funding from General Catalyst and Founder Collective,[104] the same month was "granted $910,000 by the Alfred P. Sloan Foundation to support open-source Julia development, including $160,000 to promote diversity in the Julia community",[105] and in December 2019 the company got $1.1 million funding from the US government to "develop a neural component machine learning tool to reduce the total energy consumption of heating, ventilation, and air conditioning (HVAC) systems in buildings".[106] In July 2021, Julia Computing announced they raised a $24 million Series A led by Dorilton Ventures,[107] which also owns Formula 1 team Williams Racing, that partnered with Julia Computing. Williams' Commercial Director said: "Investing in companies building best-in-class cloud technology is a strategic focus for Dorilton and Julia's versatile platform, with revolutionary capabilities in simulation and modelling, is hugely relevant to our business. We look forward to embedding Julia Computing in the world's most technologically advanced sport".[108]
Julia is a general-purpose programming language,[109] while also originally designed for numerical/technical computing. It is also useful for low-level systems programming,[110] as a specification language,[111] High-level Synthesis (HLS) tool (for hardware, e.g. FPGAs),[112] and for web programming[113] at both server[114][115] and client[116][22] side.
The main features of the language are:
Multiple dispatch (also termed multimethods in Lisp) is a generalization of single dispatch – the polymorphic mechanism used in common object-oriented programming (OOP) languages, such as Python, C++, Java, JavaScript, and Smalltalk – 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).
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 PackageCompiler.jl.[120]
Julia's syntactic macros (used for metaprogramming), like Lisp macros, are more powerful than 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 esc
construct.
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"[121] 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 |
---|---|---|---|
Julia | Dynamic | Default | Yes |
Common Lisp | Dynamic | Opt-in | Yes (but no dispatch) |
Dylan | Dynamic | Default | Partial (no dispatch) |
Fortress | Static | Default | Yes |
An example of the extensibility of Julia, the Unitful.jl package adds support for physical units of measurement to the language.
The Julia official distribution includes an interactive command-line read–eval–print loop (REPL),[122] with a searchable history, tab completion, and dedicated help and shell modes,[123] which can be used to experiment and test code quickly.[124] The following fragment represents a sample session example where strings are concatenated automatically by println:[125]
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 ;
or ?
after the prompt (preceding each command), respectively. It also keeps the history of commands, including between sessions.[126] Code 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:[121]
$ julia <filename>
Julia is supported by Jupyter, an online interactive "notebooks" environment,[127] and Pluto.jl, a "reactive notebook" (where notebooks are saved as pure Julia files), a possible replacement for the former kind.[128]
Julia is in practice interoperable with many languages (e.g. majority of top 10–20 languages in popular use). Julia's ccall
keyword is used to call C-exported or Fortran shared library functions individually, and packages are available to allow calling other languages e.g. Python, R, MATLAB, C# (and other .NET languages with DotNET.jl), JavaScript, Java (and other JVM languages, such as Scala with JavaCall.jl).[129] And packages for other languages allow to call to Julia, e.g. from Python, R, Rust or Ruby, such as with pyjulia and JuliaCall for R. Julia has also been used for hardware, i.e. to compile to VHDL, as a High-level Synthesis (HLS) tool (for e.g. FPGAs).[112]
Julia has support for Unicode 13.0[130] (or the latest Unicode 14.0 as of Julia 1.8-beta3) with UTF-8 used for strings (by default) and for Julia source code (only allowing legal UTF-8 in the latest version), meaning also allowing as an option common math symbols for many operators, such as ∈ for the in
operator.
Julia has packages supporting markup languages such as HTML (and also for HTTP), XML, JSON and BSON, and for databases and web use in general.
Julia has a built-in package manager and includes a default registry system.[131] Packages are most often distributed as source code hosted on GitHub, though alternatives can also be used just as well. Packages can also be installed as binaries, using artifacts.[132] Julia's package manager is used to query and compile packages, as well as managing environments. Federated package registries are supported, allowing registries other than the official to be added locally.[133]
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.[134] 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. 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).[135][136][137] Development of Julia began in 2009 and an open-source version was publicized in February 2012.[4][138]
While Julia has tier 1 macOS support, meaning for Intel-based Macs, the new Apple M1-based Macs only have tier 3 (experimental) support, with full support being worked on (neither does Windows on ARM).[139] However, Julia is claimed to work[140] "ok" on M1 Macs (at reduced performance) through the (automatic) use of Rosetta 2 (that needs to emulate Julia). Work on native full-speed M1 support (i.e. without emulation) is mostly done, and many programs may work if such a build of Julia is used, since all but one Julia tests pass (except for "Too many open files").
Since Julia uses JIT, Julia generates native machine code directly, before a function is first run (i.e. a different approach than compiling to bytecode, that you distribute by default, to be run on a virtual machine (VM), as with e.g. Java/JVM; then translated from the bytecode while running, as done by Dalvik on older versions of Android).
Julia has four support tiers.[141] All IA-32 processors completely implementing the i686 subarchitecture are supported and 64-bit x86-64 (aka amd64), i.e. all less than about a decade old are supported. ARMv8 (AArch64) processors are supported on second tier, and ARMv7 and ARMv6 (AArch32) are supported with some caveats (lower tier) for Julia 1.0.x and also had official executables for later versions, while 32-bit ARM support was later downgraded to tier 3 (however, unofficial binaries are available for Julia 1.5.1[142]).[143] CUDA (i.e. Nvidia GPUs; implementing PTX) has tier 1 support, with the help of an external package. There are also additionally packages supporting other accelerators, such as Google's TPUs,[144] and some Intel (integrated) GPUs, through oneAPI.jl,[145] and AMD's GPUs have support with e.g. OpenCL; and experimental support for the AMD ROCm stack.[146] Julia's downloads page provides executables (and source) for all the officially supported platforms.
On some platforms, Julia may need to be compiled from source code (e.g., the original Raspberry Pi), with specific build options, which has been done and unofficial pre-built binaries (and build instructions) are available.[147][148] Julia has been built on several ARM platforms. PowerPC (64-bit) has tier 3 support, meaning it "may or may not build". Julia is now supported in Raspbian[149] while support is better for newer Pis, e.g., those with ARMv7 or newer; the Julia support is promoted by the Raspberry Pi Foundation.[150]
There is also support for web browsers/JavaScript through JSExpr.jl;[116] and the alternative language of web browsers, WebAssembly, has minimal support[22] for several upcoming external Julia projects. Julia can compile to ARM; thus, in theory, Android apps can be made with the NDK, but for now Julia has been made to run under Android only indirectly, i.e. with a Ubuntu chroot on Android.[151]