Official Julia logo
|Paradigm||Multi-paradigm: multiple dispatch ("object-oriented"), 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|
0.7.0-beta / 24 June 2018;
|Typing discipline||Dynamic, nominative, parametric|
|Implementation language||Julia, C, Scheme (the parser; using the FemtoLisp implementation), assembly and dependencies (i.e. LLVM) in C++; standard library: Julia (mostly), C (a few dependencies), Fortran (for BLAS)|
|OS||Linux, macOS, Windows and community support for FreeBSD|
|License||MIT (core),GPL v2; a make-file option omits GPL libraries|
Julia is a high-level dynamic programming language designed to address the needs of high-performance numerical analysis and computational science, without the typical need of separate compilation to be fast, while also being effective for general-purpose programming, web use or as a specification language.
Distinctive aspects of Julia's design include a type system with parametric polymorphism and types in 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.
Julia is garbage-collected, uses eager evaluation and includes efficient libraries for floating-point calculations, linear algebra, random number generation, fast Fourier transforms (using FFTW but only in current release versions; one of the library dependencies moved out of the standard library to a package because it is GPL licensed, and thus will not be included in Julia 1.0 by default) and regular expression matching.
Work on Julia was started in 2009 by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman who set out to create a 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. Since then, the Julia community has grown, with over 1,800,000 downloads as of January 2018. It has attracted some high-profile clients, 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 before (previously used MATLAB). 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, Jeff Reiger, 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 supercomputer (the 5th fastest in the world at the time; 8th fastest as of November 2017). Julia thus joins C, C++, and Fortran as high-level languages in which petaFLOPS computations have been written.
According to the official website, 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 - 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 be subtyped, but composition is used over inheritance, that is used by traditional object-oriented languages (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, while another way is possible, where a standalone executable can be made that needs no Julia source code built with BuildExecutable.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>
ccall keyword is used to call C-exported or Fortran shared library functions individually.
Julia has Unicode 10 support, with UTF-8 used for strings (by default) and for Julia source code, meaning allowing as an option common math symbols for many operators, such as ? for the
Julia's core is implemented in Julia, C (and the LLVM dependency is in C++), assembly and its parser in Scheme ("FemtoLisp"). 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), although these benchmark claims are often disputed. Development of Julia began in 2009 and an open-source version was publicized in February 2012.
Julia 0.6 "is now considered the stable line of releases and is recommended for most users, as it provides both language and API stability" and is on a monthly release schedule where bugs are fixed and some new features from 0.7-DEV are backported. In contrast the 0.5 release line (and older) is not is actively worked on; it only gets backported with bug fixes on an irregular schedule and older lines are no longer maintained.
While Julia uses JIT (MCJIT from LLVM) - it still means Julia generates native machine code, directly, before a function is first run (not a bytecode that is run on a virtual machine (VM) or translated as the bytecode is running, as with e.g., Java; the JVM or Dalvik in Android).
Current support is for 32- and 64-bit x86 processors (all except for ancient pre-Pentium 4-era, to optimized for newer), while Julia also supports more, e.g. "fully supports ARMv8 (AArch64) processors, and supports ARMv7 and ARMv6 (AArch32) with some caveats." Other platforms (other than those mainstream CPUs; or non-mainstream operating systems), have "Community" support, or "External" support (meaning in a package), e.g. for GPUs.
At least some platforms may need to be compiled from source code (e.g. the original Raspberry Pi), with options changed, while the download page has otherwise executables (and the source) available. Julia has been "successfully built" on several ARM platforms, up to e.g. "ARMv8 Data Center & Cloud Processors", such as Cavium ThunderX (first ARM with 48 cores). ARM v7 (32-bit) and ARM v8 (64-bit) has "Official" support and binaries (first to get after x86), while PowerPC (64-bit) has "Community" support and PTX (64-bit) (meaning Nvidia's CUDA on GPUs) has "External" support.
Julia is now supported in Raspbian while support is better for newer (e.g.) ARMv7 Pis; the Julia support is promoted by the Raspberry Pi Foundation. Support for GNU Hurd is being worked on (in JuliaLang's openlibm dependency project).
A Julia2C source-to-source compiler from Intel Labs is available. This source-to-source compiler is a fork of Julia, that emits C code (and makes the full Julia implementation not needed, for that generated C code) instead of native machine code, for functions or whole programs; this makes Julia effectively much more portable, as C is very portable with compilers available for most CPUs. The compiler is also meant to allow analyzing code at a higher level than C.
Intel's ParallelAccelerator.jl can be thought of as a partial Julia to C++ compiler (and then to machine code transparently), but the objective is parallel speedup (can be "100x over plain Julia", for the older 0.4 version, and could in cases also speed up serial code many fold for that version); not compiling the full Julia language to C++ (C++ is only an implementation detail, later versions might not compile to C++). It doesn't need to compile all of Julia's syntax, as the rest is handled by Julia.
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.
Julia's Base library, largely written in Julia itself, also integrates mature, best-of-breed open source C and Fortran libraries for ...
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.
He has co-designed the programming language Scheme, which has greatly influenced the design of Julia
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.
to import modules (e.g. python3-numpy)
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).
Version 10.30 14-August-2017 [..] 10. The Unicode tables are upgraded from Unicode 8.0.0 to Unicode 10.0.0.
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.
A list of known issues for ARM is available.
Julia works on all the Pi variants, we recommend using the Pi 3.
By translating Julia to C, we leverage the high-level abstractions (matrix, vector, ..), which are easier to analyze, and can potentially add the rich extensions of C (like openmp, tbb, ...).
The tool may also extend Julia to new architectures where the only available tool chain is for C
Translation from C to Julia might be harder.