Programming Languages Section

Julia Programming Language

Card image
Post by Amina Delali, March 31th, 2022

Some Facts

Julia is a general-purpose dynamic typed programming language. It implements object oriented and functional paradigms as well as as multi dispatch mechanism. It is known to be easy to write as Python and fast to run as C. It also can be the alternative to R and Python languages for Data Science and Machine Learning projects, even if Julia is also compatible with these two languages.



How to install it

  • on Windows:

    To install Julia onWindows (7 and later), you have to simply download and run the installer. Be careful to select the appropriate installer for your system (32-bits or 64-bits) that you can find in this download page. Also, don't forget to check the "Add Julia To PATH " box, so Julia will automatically added to your Environment Variables.

  • on Ubuntu :

    To install Julia on Ubuntu, just do this:

    1. Download and extract the Julia archive using the terminal with the following commands:$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.2-linux-x86_64.tar.gz  
      $ tar zxvf julia-1.7.2-linux-x86_64.tar.gz

    2. You can change the previous commands to download the actual latest version of Julia. You can get the download's path  from this download page (or you can simply download it from there).

    3. Get the path to Julia's downloaded Bin folder, and add it to your path variable. If you run the previous commands from the home folder, the path to add will be as follow: "/home/your-username/julia-1.7.2/bin". To add the path, you can edit the bashrc file using nano from the terminal:$ sudo nano ~/.bashrc
      then add the following line:  export PATH="$PATH:/home/your-username/julia-1.7.2/bin"
       
      To apply the changes, run the following command: run $ source ~/.bashrc
    4. To test the installation, just run on the terminal:$ julia -v

The Hello World Example

The steps are simple:

  1. Create a new file named hello.jl and save it in you home folder (or a specific folder, that you will later open in the terminal).

  2. In the hello.jl file, write and save the following code:
    println("Hello World!")

  3. Open the terminal from the home folder (or the folder where you saved your file), then run this command:
    julia hello.jl


Something to say ?

If you want to add something about the language or about this post, please feel free to do it by commenting below 🙂 .