Getting started with Julia

Introduction to Julia

James Fulton

Climate informatics researcher

What is Julia?

  • An open-source language designed for data science
  • Newer than other common languages
  • General purpose
  • Designed for scientific computing and data tasks

The Julia programming language logo.

A table showing the release dates of the MATLAB, Python, R and Julia programming languges. Julia is the most recently released.

Introduction to Julia

Why create Julia?

Designed by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman

Julia was designed to be:

  • Simple to learn
  • Able to keep the most serious hackers happy
  • As usable for general programming as Python
  • As easy for statistics as R
  • As powerful and natural for linear algebra as MATLAB
  • Speed of C
1 https://julialang.org/blog/2012/02/why-we-created-julia
Introduction to Julia

This course

  • For beginner programmers
  • Basics of Julia
  • Working with data in Julia

The Julia programming language logo.

Introduction to Julia

Installing Julia

Introduction to Julia

Scripts vs. the console

The console

A gif showing an example of using the console. The number one is types into the console and the same number is printed to console.

Introduction to Julia

Scripts vs. the console

The console

A gif showing how the output from the console can be supressed using a semicolon.

Introduction to Julia

Scripts vs. the console

An image of the DataCamp script editor.

Introduction to Julia

Simple calculations and printing

Inside script.jl:

# Print the number 2
println(2)

# Print the sum of 1+2
println(1+2)
2
3
Introduction to Julia

Comments

Inside script.jl:

# Print the number 2        <--- these are comments
println(2)

# Print the sum of 1+2      <--- these are comments
println(1+2)
2
3
Introduction to Julia

Comments

Inside script.jl:

Print the number 2
println(2)

Print the sum of 1+2
println(1+2)
ERROR: LoadError: syntax: extra token "the" after end of expression
Stacktrace:
 [1] top-level scope
   @ ~/script.jl:1
Introduction to Julia

Multi-line comments

Inside script.jl:

#=


=#
println(2)
2
Introduction to Julia

Multi-line comments

Inside script.jl:

#=
Print the 
number 2
=#
println(2)
2
Introduction to Julia

Let's practice!

Introduction to Julia

Preparing Video For Download...