Julia 101

Note: The author is also a newbie to Julia, and to me this document is meant to be a note of what I have learned from the literatures. Were there some misconceptions or unclearness, please let me know. Comments and suggestions are also welcome.

About Julia

What is Julia?

Why Julia?

According to its officiel website, Julia boasts the following advantages: fast, dynamic, reproducible, composable, general, open source. What these features mean to me is that I don't need to pay MATLAB to enjoy a similar syntax, and it is reasonably fast yet concise that I don't need to resort to C/C++ to pursue performance. To me, the more I code with the language, the better I realize how much these merits benefits the scientific computing.

How do I learn Julia?

The officiel website includes a great abundance of resources, ranging from the download link of the compiler, the official documentation (with detailed yet comprehensible explanations) to learning materials. I closely follow one of the texts, and if I found something unfamiliar, I will look it up in the documentation or simply google it.

Here I include some of the useful resources:

Installation

  1. Go to Julia's website https://julialang.org and download and install the latest stable release of Julia.

  • For Windows users, download the installer and click on the installer to install, or download the portable version and extract files.

  • For Linux or Mac users, download the corresponding package and extract/install it.

  1. Run Julia REPL [1] by executing bin/julia!

Use Pluto.jl

Pluto.jl is an lightweight interactive notebook for Julia. It is helpful for the users to conduct experiments, and it comes in handy when you want to export your computation as html to create a live demo.

Installation

To install Pluto [2], type ] to enter package manager Pkg in Julia:

julia> ]

Enter add Pluto to add the package:

(@v1.9) pkg> add Pluto

To exit package manager, press Ctrl+C or Backspace

(@v1.9) pkg> ^C

Start Pluto

To use Pluto, we need to first import it

julia> import Pluto
julia> Pluto.run()

It will automatically open a webpage of Pluto notebook. If not, you may copy the link printed on screen (something like http://localhost:1234/?secret=xxxxxxxx) to the browser.

Final notes

[1] See for example here for an explanation.
[2] Check also here if you face any difficulties.