Wed Aug 29 2018

Julia programming language and its features

Programming1982 views

Julia programming language and its features

Julia is a general-purpose programming language that made specifically for scientific computing. It's dynamically-typed, feels like a scripting language, and has good support for interactive use. It was designed from the beginning for high performance. Julia programs compile to efficient native code for multiple platforms via LLVM. These include various mathematical libraries, data manipulation tools, and packages for general purpose computing. In addition to these, you can easily use libraries from Python, R, C/Fortran, C++, and Java. It has a rich language of descriptive data types, and type declarations can be used to clarify and solidify programs. Julia uses multiple dispatches as a paradigm, making it easy to express many object-oriented and functional programming patterns. The standard library provides asynchronous I/O, process control, logging, profiling, a package manager, and more. It excels at numerical computing. Its syntax is great for math, many numeric data types are supported, and parallelism is available out of the box. Julia's multiple dispatches is a natural fit for defining the number and array-like data types.

To work on Julia was started in 2009, by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman who wanted 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. Since 2012, the Julia community has grown, with over 2,000,000 downloads as of August 2018. Both Julia 0.7 and the related version 1.0 were released on 8 August 2018; 19 days ago. The most notable aspect of Julia's implementation is its speed, which is often within a factor of two relatives to the fully optimized C code.

Julia is now supported in Raspbian while support is better for newer ARMv7 Pis. A Julia2C source-to-source compiler from Intel Labs is available. This source-to-source compiler is a fork of Julia that implements the same Julia language syntax. It emits 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.

Features of Julia

Dynamic typing

You can specify types for variables like the unsigned 32-bit integer. You can also create hierarchies of types to allow general cases for handling variables of specific types - for instance, to write a function that accepts integers generally without specifying the length or signing of the integer. You can do without typing entirely if it isn’t needed in a particular context.

Compiled for speed

An additional feature of Julia is speed. Julia complies codes on the fly, reaching an incredible velocity. Julia is just-in-time (JIT) compiled using the LLVM compiler framework. At its best, Julia can approach or match the speed of C. Julia is designed to be faster right out of the gate.

Metaprogramming

Julia programs can generate other Julia programs, and even modify their own code, in a way that is reminiscent of languages like Lisp.

Syntax

Julia’s syntax for math operations looks more like the way math formulas are written outside of the computing world, making it easier for non-programmers to pick up on. Although, Julia’s syntax is similar to Python’s - terse, but also expressive and powerful.

Libraries

Julia can interface directly with external libraries written in C and Fortran. It’s also possible to interface with Python code by way of the PyCall library and even share data between Python and Julia.

Parallelism

Math and scientific computing thrive when you can make use of the full resources available on a given machine, especially multiple cores. Both Python and Julia can run operations in parallel. But Julia’s syntax is slightly less top-heavy than Python’s, lowering the threshold to its use.

Packages

Packages are an important feature of Julia. Due to its built-in package manager, it already has over 1500 registered packages, and the number keeps increasing. This language also provides the possibility to resort to C, Fortran and Python packages which makes it easy to run existing code.

Advantages of Julia

  • Free and open source (MIT licensed).

  • Powerful shell-like capabilities for managing other processes.

  • User-defined types are as fast and compact as built-ins.

  • Designed for parallelism and distributed computation.

  • Lightweight "green" threading.

  • Efficient support for Unicode, including but not limited to UTF-8.

  • Lisp-like macros and other metaprogramming facilities.

  • Unobtrusive yet powerful type system.

  • Elegant and extensible conversions and promotions for numeric and other types.

  • Call C functions directly.

  • No need to vectorize code for performance; the de-vectorized code is fast.

Download

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.