Julia - first contact
General information
Resources
This notebook tries to give a first introduction to Julia, featuring standard features which can be found in other languages as well. More Julia-specific things come later.
Julia is an Open Source project started at MIT
Julia itself is distributed under an MIT license
packages often have different licenses
Development takes place on github
As of October 2021, more than 1200 contributors to the code
The Open Source paradigm corresponds well to the fundamental requirement that scientific research should be transparent and reproducible
How to install and run Julia
Installation:
Download from julialang.org (recommended by Julia creators)
Long term support (LTS) Version: 1.6
Current stable version: 1.8.2 (recommended for this course)
Installation via system package manager (yast, apt-get, homebrew...)
Workflows:
Pluto notebooks in the browser
From command line: Edit source code in any editor
Julia plugin of Visual Studio code editor
Jupyter notebooks in the browser
Standard number types
Julia is a strongly typed language, so any variable has a type.
Standard number types allow fast execution because they are supported in the instruction set of the processors
Default types are autodected from expression
The
typeof
function allows to detect the type of a variableThe
sizeof
funtion detects the size in bytes of a variable (1 byte = 8 bit)
Integers
Integer variables are used to represent integer numbers.
10
Int64
8
Besides of the default Int64
type, Julia knows Int8
, Int16
, Int32
10
Int16
2
Floating point numbers
Floating point variables are used to represent real numbers up to some precision.
10.0
Float64
8
There is also Float16
, Float32
144.3
4