Julia (programming language)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Julia
Julia prog language.svg
ParadigmMulti-paradigm: multiple dispatch, procedural, functional, meta, multistaged[1]
Designed byJeff Bezanson, Alan Edelman, Stefan Karpinski, Viral B. Shah
DeveloperJeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors[2][3]
First appeared2012; 7 years ago (2012)[4]
Stable release
1.1.0[5] / 21 January 2019; 2 months ago (2019-01-21)
Preview release
1.2.0-DEV[6] / daily updates
Typing disciplineDynamic, nominative, parametric, optional
Implementation languageJulia, C, C++, Scheme, LLVM[7]
Platformx86-64, IA-32, ARM
OSLinux, macOS, Windows and FreeBSD
LicenseMIT (core),[2] GPL v2;[7][8] a makefile option omits GPL libraries[9]
Filename extensions.jl
WebsiteJuliaLang.org
Influenced by

Julia is a high-level general-purpose[13] dynamic programming language whose designers intend it to address the needs of high-performance numerical analysis and computational science, without the need of separate compilation to be fast.[14][15][16][17] It is also useful for low-level systems programming,[18] as a specification language,[19] with work being done on client[20] and server web use.[21]

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,[22] 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.[23]

History[edit]

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.[24] 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."[25] Bezanson said he chose the name on the recommendation of a friend.[26]

Since the 2012 launch, the Julia community has grown, with over 3,200,000 downloads as of January 2019[27]. The Official Julia Docker images have seen over 1,000,000 downloads.[28]. The JuliaCon[29] 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.[30] Versions 0.5 and earlier are no longer maintained.[31] Julia 0.6 was released in June 2017,[32] and was the stable release version until 8 August 2018.

Both Julia 0.7 (a useful release for testing packages, and knowing how to upgrade them for 1.0[33]) 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.[34]

The release candidate for Julia 1.0 (Julia 1.0.0-rc1) was released on 7 August 2018, and the final version a day later. The team has stated code that runs without warnings on Julia 0.7 will run identically on Julia 1.0.[35]

Julia 1.1 was released on 21 January 2019 with, e.g., a new "exception stack" language feature. As promised (by the semantic versioning Julia, and many of the external packages, follows) all old syntax from Julia 1.0 should still work, while Julia 1.1 may not work in Julia 1.0. There are mostly non-breaking additions to the standard library, while there are some small changes explained in Julia's NEWS file.

Bugfix releases are expected roughly monthly, for Julia 1.1.x and 1.0.x (1.0.x currently has long-term support; for at least a year) and Julia 1.0.1, 1.0.2, and 1.0.3 have followed that schedule (no such bugfix releases in the pipeline for 0.7-release). Julia 1.2 is due 15 March 2019.[36]

Notable uses[edit]

Julia 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 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[37] conference, Jeffrey Regier, Keno Fischer and others announced[38] that the Celeste project[39] used Julia to achieve "peak performance of 1.54 petaFLOPS using 1.3 million threads"[40] on 9300 Knights Landing (KNL) nodes of the Cori (Cray XC40) supercomputer (the 5th fastest in the world at the time; by November 2017 was 8th fastest). 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."[41]

Sponsors[edit]

Julia has received contributions from 800 developers worldwide.[42] 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.[43]

Language features[edit]

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[a]
  • 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 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"[48] 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

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 ApplicationBuilder.jl[49] and PackageCompiler.jl.[50]

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 esc construct.

Interaction[edit]

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.[51] The following fragment represents a sample session example where strings are concatenated automatically by println:[52]

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.[53] 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:[48]

 $ julia <filename>

Julia is supported by Jupyter, an online interactive "notebooks" environment.[54]

Use with other languages[edit]

Julia's ccall keyword is used to call C-exported or Fortran shared library functions individually.

Julia has Unicode 11.0 support, 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 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.

Implementation[edit]

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),[55][56][57] Development of Julia began in 2009 and an open-source version was publicized in February 2012.[4][58]

Current and future platforms[edit]

While Julia uses JIT[59] (MCJIT[60] 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 most IA-32 ("x86") processors, i.e., in 32-bit mode (all x86 CPUs except for the very old 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."[61] Other platforms (other than those mainstream CPUs; or non-mainstream operating systems), have tier 2 or 3 support (or tier 4 if not known to build), 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) has tier 2 support and binaries (first to get after x86), while ARM v8 (64-bit) and PTX (64-bit) (meaning Nvidia's CUDA on GPUs) has "External" support. PowerPC (64-bit) had for pre-1.0 versions "Community" support but at least in the current version it ranked under tier 4 support "known not to build".

Julia is now supported in Raspbian[62] while support is better for newer, e.g., ARMv7 Pis; the Julia support is promoted by the Raspberry Pi Foundation.[63]

Julia Computing company[edit]

Julia Computing, Inc. was founded by Viral B. Shah, Deepak Vinchhi, Alan Edelman, Jeff Bezanson, Stefan Karpinski and Keno Fischer.[64]

In June 2017, Julia Computing raised $4.6M in seed funding from General Catalyst and Founder Collective.[65]

See also[edit]

Notes[edit]

  1. ^ For calling the newer Python 3 (the older default to call Python 2, is also still supported)[44][45] (and PyPy[46]) and calling in the other direction, from Python to Julia, is also supported with pyjulia.[47]

References[edit]

  1. ^ "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.
  2. ^ a b "LICENSE.md". GitHub.
  3. ^ "Contributors to JuliaLang/julia". GitHub.
  4. ^ a b c d e f g h "Why We Created Julia". Julia website. February 2012. Retrieved 7 February 2013.
  5. ^ "v1.1.0". Github.com. 2019-01-21. Retrieved 2019-01-22.
  6. ^ "Set VERSION to 1.2.0-DEV by ararslan · Pull Request #30321 · JuliaLang/julia". GitHub. Retrieved 2018-12-13.
  7. ^ a b "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 ...
  8. ^ "Non-GPL Julia?". Groups.google.com. Retrieved 2017-05-31.
  9. ^ "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.
  10. ^ a b c d "Home · The Julia Language". docs.julialang.org. Retrieved 2018-08-15.
  11. ^ "Programming Language Network". GitHub. Retrieved 6 December 2016.
  12. ^ "JuliaCon 2016". JuliaCon. Retrieved 6 December 2016. He has co-designed the programming language Scheme, which has greatly influenced the design of Julia
  13. ^ "The Julia Language" (official website). General Purpose [..] Julia lets you write UIs, statically compile your code, or even deploy it on a webserver.
  14. ^ Bryant, Avi (15 October 2012). "Matlab, R, and Julia: Languages for data analysis". O'Reilly Strata. Archived from the original on 2014-04-26.
  15. ^ Singh, Vicky (23 August 2015). "Julia Programming Language – A True Python Alternative". Technotification.
  16. ^ Krill, Paul (18 April 2012). "New Julia language seeks to be the C for scientists". InfoWorld.
  17. ^ Finley, Klint (3 February 2014). "Out in the Open: Man Creates One Programming Language to Rule Them All". Wired.
  18. ^ 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.
  19. ^ 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. Airborne collision avoidance system
  20. ^ Fischer, Keno (2019-02-03), Running julia on wasm., retrieved 2019-02-09
  21. ^ "Getting Started with Node Julia · Node Julia". Node-julia.readme.io. Retrieved 2017-05-31.
  22. ^ "Suspending Garbage Collection for Performance...good idea or bad idea?". Groups.google.com. Retrieved 2017-05-31.
  23. ^ (now available with using FFTW in 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 2018-03-01.
  24. ^ 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)
  25. ^ Stefan Karpinski, New Julia language seeks to be the C for scientists, Infoworld, 18 April 2012
  26. ^ Torre, Charles. "Stefan Karpinski and Jeff Bezanson on Julia". Channel 9. MSDN. Retrieved 4 December 2018.
  27. ^ "Julia Computing Newsletter, Growth Metrics". juliacomputing.com. Retrieved 2019-02-11.
  28. ^ https://hub.docker.com/_/julia
  29. ^ "JuliaCon website". juliacon.org. Retrieved 2018-05-10.
  30. ^ The Julia Blog
  31. ^ Julia Download (Old Releases), julialang.org
  32. ^ https://julialang.org/blog/2017/06/julia-0.6-release
  33. ^ "What is Julia 0.7? How does it relate to 1.0?". JuliaLang. Retrieved 2018-10-17.
  34. ^ Eric Davies. "Writing Iterators in Julia 0.7". julialang.org. Retrieved 2018-08-05.CS1 maint: Uses authors parameter (link)
  35. ^ What is Julia 0.7? How does it relate to 1.0?, Stefan Karpinski, 27 March 2018
  36. ^ The Julia Language: A fresh approach to technical computing.: JuliaLang/julia, The Julia Language, 2019-01-22, retrieved 2019-01-22
  37. ^ "JuliaCon 2017". juliacon.org. Retrieved 2017-06-04.
  38. ^ Fisher, Keno. "The Celeste Project". juliacon.org. Retrieved 24 June 2017.
  39. ^ 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].
  40. ^ 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.
  41. ^ "Julia language co-creators win James H. Wilkinson Prize for Numerical Software". MIT News. Retrieved 2019-01-22.
  42. ^ The Julia Language: A fresh approach to technical computing.: JuliaLang/julia, The Julia Language, 2019-01-26, retrieved 2019-01-26
  43. ^ "Julia Sponsors, Research, and Publications".
  44. ^ "PyCall.jl". stevengj. github.com.
  45. ^ "Using PyCall in julia on Ubuntu with python3". julia-users at Google Groups. to import modules (e.g., python3-numpy)
  46. ^ "Polyglot.jl". wavexx. github.com.
  47. ^ "python interface to julia".
  48. ^ a b "Learn Julia in Y Minutes". Learnxinyminutes.com. Retrieved 2017-05-31.
  49. ^ Daly, Nathan (2019-02-13), Compile, bundle, and release julia software. Contribute to NHDaly/ApplicationBuilder.jl development by creating an account on GitHub, retrieved 2019-02-15
  50. ^ Compile your Julia Package. Contribute to JuliaLang/PackageCompiler.jl development by creating an account on GitHub, The Julia Language, 2019-02-14, retrieved 2019-02-15
  51. ^ "Getting Started · The Julia Language". docs.julialang.org. Retrieved 2018-08-15.
  52. ^ See also: https://docs.julialang.org/en/stable/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).
  53. ^ "Julia Documentation". JuliaLang.org. Retrieved 18 November 2014.
  54. ^ "Project Jupyter".
  55. ^ "Julia: A Fast Dynamic Language for Technical Computing" (PDF). 2012.
  56. ^ "How To Make Python Run As Fast As Julia". 2015.
  57. ^ "Basic Comparison of Python, Julia, R, Matlab and IDL". 2015.
  58. ^ Gibbs, Mark (9 January 2013). "Pure and Julia are cool languages worth checking out". Network World (column). Retrieved 7 February 2013.
  59. ^ "Support MCJIT". Github.com. Retrieved 26 May 2015.
  60. ^ "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.
  61. ^ julia: The Julia Language: A fresh approach to technical computing, The Julia Language, 2018-02-01, retrieved 2018-02-01, A list of known issues for ARM is available.
  62. ^ "Julia available in Raspbian on the Raspberry Pi". Julia works on all the Pi variants, we recommend using the Pi 3.
  63. ^ "Julia language for Raspberry Pi". Raspberry Pi Foundation.
  64. ^ "About Us – Julia Computing". juliacomputing.com. Retrieved 2017-09-12.
  65. ^ https://juliacomputing.com/press/2017/06/19/funding.html

External links[edit]