Getting started with Julia

Einführung in 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.

Einführung in 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
Einführung in Julia

This course

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

The Julia programming language logo.

Einführung in Julia

Installing Julia

Einführung in 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.

Einführung in Julia

Scripts vs. the console

The console

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

Einführung in Julia

Scripts vs. the console

An image of the DataCamp script editor.

Einführung in 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
Einführung in 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
Einführung in 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
Einführung in Julia

Multi-line comments

Inside script.jl:

#=


=#
println(2)
2
Einführung in Julia

Multi-line comments

Inside script.jl:

#=
Print the 
number 2
=#
println(2)
2
Einführung in Julia

Let's practice!

Einführung in Julia

Preparing Video For Download...