World Library  
Flag as Inappropriate
Email this Article

Julia (programming language)

Article Id: WHEBN0038455554
Reproduction Date:

Title: Julia (programming language)  
Author: World Heritage Encyclopedia
Language: English
Subject: List of programming languages by type, Comparison of numerical analysis software, Generational list of programming languages, R (programming language), GNU Octave
Collection: 2012 Software, Data-Centric Programming Languages, Dynamically Typed Programming Languages, Free Data Analysis Software, Free Data Visualization Software, Free Software Projects, Free Statistical Software, High-Level Programming Languages, Numerical Analysis Software for Linux, Numerical Analysis Software for Os X, Numerical Analysis Software for Windows, Numerical Linear Algebra, Numerical Programming Languages, Object-Oriented Programming Languages, Parallel Computing, Programming Languages Created in 2012, Programming Languages Created in the 2010S, Software Using the Mit License
Publisher: World Heritage Encyclopedia

Julia (programming language)

Official Julia logo
Paradigm(s) Multi-paradigm: multiple dispatch ("object-oriented"), procedural, functional, meta
Designed by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, Alan Edelman
Developer Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors[1][2]
Appeared in 2012[3]
Stable release 0.3.3 / 23 November 2014 (2014-11-23)[4]
Preview release 0.4.0-dev / Updated daily
Typing discipline Dynamic with type inference and optional type annotations
Influenced by MATLAB, Scheme, Lisp, C, Fortran, Wolfram Language, Python, Perl, R, Ruby, Lua[5]
OS Linux, OS X, FreeBSD, Windows
License MIT License[1]
Filename extension(s) .jl
Website .orgjulialang

Julia is a high-level dynamic programming language designed to address the requirements of high-performance[6] numerical and scientific computing while also being effective for general purpose programming.[7][8][9][10] Distinctive aspects of Julia's design include having a type system with parametric types in a fully dynamic programming language, and adopting multiple dispatch as its core programming paradigm. It allows for parallel and distributed computing, and direct calling of C and Fortran libraries without glue code. Julia is garbage collected by default[11] and unlike other functional languages that use lazy evaluation Julia uses eager evaluation (with the package Lazy.jl providing "cornerstones of functional programming - lazily-evaluated lists and a large library of functions for working with them"[12]) and includes efficient libraries for floating point, linear algebra, random number generation, fast Fourier transforms, and regular expression matching.


  • Language features 1
  • Interaction 2
  • Packages 3
  • For use in statistics/data analysis 4
  • Seeing generated assembly just after typing code in 5
  • Implementation 6
    • Embedding in other languages 6.1
  • References 7
  • External links 8

Language features

According to the official web site, 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
  • Built-in package manager
  • Lisp-like macros and other metaprogramming facilities
  • Call Python functions: use the PyCall package (also works for newer Python 3[13][14])
  • Call C functions directly: no wrappers or special APIs
  • Powerful shell-like capabilities for managing other processes
  • Designed for parallelism and distributed computation
  • 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

Julia draws significant inspiration from various dialects of Lisp, including Scheme and Common Lisp, and it shares many features with Dylan (such as an ALGOL-like syntax rather than a Scheme-like prefix syntax) – also a multiple-dispatch-oriented dynamic language – and Fortress, another numerical programming language with multiple dispatch and a sophisticated parametric type system. While CLOS adds multiple dispatch to Common Lisp, the addition is opt-in: only user-defined functions explicitly declared to be generic can be extended with new multimethods.

In Julia, Dylan and Fortress, on the other hand, this 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 compilation and execution phases. This matrix of language features is 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


The Julia official distribution include an interactive session shell, called Julia's REPL, which can be used to experiment and test code quickly.[15] The following fragment represents a sample session on the REPL:

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. The REPL also keeps the history of commands, even between sessions. For other examples, see the Julia documentation,[16] which gives 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 (for example):[17]

bash> julia 


In the Julia packaging system each package is a Git repository that can be stored in any publicly accessible location. A master package listing that includes package dependency information is maintained in METADATA.jl,[18] enabling installation from the Julia prompt using Pkg.add("PackageName")

Packages are typically written in Julia but can include both binaries and code written in other languages, which can be automatically compiled at package install time by the package manager. To load the installed package into Julia, one can run using PackageName. As Julia is case sensitive, Using PackageName is not the same thing and produces an error. Updating Julia's installed packages can also be done using Pkg.update(). Many packages are available[19] to call other languages from within Julia. For example, a package, JavaCall.jl/, is available to call Java from Julia.[20]

For use in statistics/data analysis

Julia was created to be "as easy for statistics as R [language]" as one of its goals.[3]

When Julia may not have some software library for statistics, a package Rif.jl (and RCall.jl[21] or to call Julia from R: RJulia.jl) is available for Julia for "calling R whenever it has a library that would be needed".[22]

Also at least one package Gadfly.jl is available for Julia for "statistical graphics" a "plotting and data visualization system written in Julia".[23] For working with distributions a package Distributions.jl is available.[24]

As for what comes with Julia itself (without installing R and using together): "Rmath is a library from R, which includes basic statistical functions. Julia uses a patched version of Rmath, which uses DSFMT as its underlying generator, and faster normal random number generators."[25][26]

Julia's documentations has a section "Noteworthy differences from R"[27] and buried in the documentation elsewhere: "For situations where a value exists only sometimes (for example, missing statistical data), it is best to use the Nullable{T} type, which allows specifying the type of a missing value"[28] (for missing data and tabular data for though see DataArrays.jl and DataFrames.jl packages). What academics say: "Julia code looks very much like R code and/or Matlab/octave code. It is, of course, not identical but sufficiently similar to be readable."[29]

"There are now several packages that, taken as a whole, suggest that Julia may really live up to its potential and become the next generation language for data analysis."[30] See here for STATISTICS section (and OPERATIONS RESEARCH, Econometrics and Valuation - Finance) as an overview.

"In practical terms, multiple dispatch turns object orientated programming on its head, instead of encapsulating functions or methods inside data structures or objects, functions are effectively overloaded on different data structures. The object oriented paradigm is not a natural way for data-scientists or algorithmists to work, one of the great things about R is to allow programs to be created quickly and simply by providing a nice and powerful programming interface. Julia takes this one step futher and makes it explicit and clear, that we are writing functions for specific data structures - but with an option to write "catch-all" functions to deal with any data type [..] Sometimes people ask whether R or Python will be the most used "data science" programming language, we now have a dark horse, a late entrant to the race, a new kid on the block that could one day grab this particular crown."[31]

Seeing generated assembly just after typing code in

You can see the compiled assembly code for any just typed in function (for built-in, after it has been run at least once); including in-built functions such as the operator + that is just a function through syntactic sugar:

julia> code_native(+, (Float64, Float64))
Warning: Unable to find function pointer
ERROR: no method found for the specified argument types
in code_native at reflection.jl:159

julia> 1.0 + 2.0

julia> code_native(+, (Float64, Float64))
Filename: float.jl
Source line: 120
        push    RBP
        mov     RBP, RSP
Source line: 120
        addsd   XMM0, XMM1
        pop     RBP


Julia's core is implemented in C and C++, its parser in Scheme ("femtolisp"), and the LLVM compiler framework is used for just-in-time generation of 64-bit or 32-bit optimized machine code depending on platform or user override. Current support is for newer x86 or older i386 processors and in 0.4.0-dev, 32-bit ARMv7 ("Experimental and early support"[32] with "work in progress - several tests are known to fail, and backtraces are not available"[33]).[34][35][36][37][38][39] The standard library is implemented in Julia itself, using Node.js's libuv library for efficient, cross-platform I/O. 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).[40] Development of Julia began in 2009 and an open-source version was publicized in February 2012.[3][41]

Julia uses a mark and sweep garbage collection (GC) algorithm. For high-performance computing that choice is not a problem, but for real-time-sensitive such as audio work it can be, where an incremental implementations for Julia does much better.[42] It was marked as a milestone for version 0.4, but only generational GC behavior may end up in that version.[43]

Julia, the 0.3 line, is on a monthly release schedule where bugs are fixed and some new things from 0.4 are backported.[44]

Embedding in other languages

The Julia C API allows the implementation of Julia to be used from within other languages (unless where target CPU isn't supported by both), such as Python (thus both languages have been made to call each other, even recursively) C++, C#, or C.[45] In languages that support exceptions, Julia's exceptions can be caught and rethrown natively as in the languages mentioned here (except for C that doesn't have exception; in those languages Julia's exceptions should be caught and handled).

A Julia2C source-to-source compiler from Intel is available.

A library to call C++ is available that relies on "staged functions" feature only available in 0.4.0-dev.


  1. ^ a b "".  
  2. ^ "Contributors to JuliaLang/julia".  
  3. ^ a b c "Why We Created Julia". Julia website. February 2012. Retrieved 7 February 2013. 
  4. ^
  5. ^
  6. ^ beats Fortran in some cases and even C
  7. ^ "The Julia Language" (official website). 
  8. ^ Bryant, Avi (15 October 2012). "Matlab, R, and Julia: Languages for data analysis". O'Reilly Strata. 
  9. ^ Krill, Paul (18 April 2012). "New Julia language seeks to be the C for scientists". InfoWorld. 
  10. ^ Finley, Klint (3 February 2014). "Out in the Open: Man Creates One Programming Language to Rule Them All". Wired. 
  11. ^ "Suspending Garbage Collection for Performance...good idea or bad idea?". 
  12. ^
  13. ^!topic/julia-users/lDM7-YXT2LU
  14. ^
  15. ^ Julia REPL documentation
  16. ^ "Julia Documentation". Retrieved 18 November 2014. 
  17. ^ Learn Julia in Y Minutes
  18. ^ "METADATA.jl" (central package listing for Julia)
  19. ^ "Julia Package Library". Retrieved 18 November 2014. 
  20. ^
  21. ^
  22. ^
  23. ^ statistical graphics for Julia
  24. ^
  25. ^
  26. ^
  27. ^
  28. ^
  29. ^
  30. ^
  31. ^
  32. ^
  33. ^
  34. ^
  35. ^ ARM test failures
  36. ^ ARM nightlies
  37. ^ Segfault using Pkg on ARM
  38. ^ build changes for ARM #7662
  39. ^ Port to ARM #3134
  40. ^ "Julia: A Fast Dynamic Language for Technical Computing" ( 
  41. ^ Gibbs, Mark (9 January 2013). "Pure and Julia are cool languages worth checking out". Network World (column). Retrieved 7 February 2013. 
  42. ^ WIP: Incremental GC
  43. ^ Generational behavior for the garbage collector
  44. ^
  45. ^

External links

  • Official website
  • The Julia Manual
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.