AaltoRSE / julia-introduction

Two-day introduction course to Julia programming language
MIT License
9 stars 7 forks source link

Introduction to Julia

This repository contains the content for the Introduction to Julia course by Aalto SciComp.

Julia is a new emerging high-level, high-performance programming language. It aims to be simple to write and fast to run. In this course, we will introduce the basic concepts of programming with Julia. We will also discuss selected Julia packages and give an introduction to the Julia ecosystem. The course contains both lectures and hands-on exercises. All the material is provided as interactive notebooks.

The course is aimed for everybody with beginner to intermediate level of skills in programming. However, the notebooks and exercises also contain extra material marked with Advanced tags that are aimed for the more experienced users. Don't feel overwhelmed by them, some of them can be very specific to some particular field of science. Instead, if you find some of them interesting, feel free to just mess around with them and have some fun. That is the whole point of programming with a high-level language anyway!

Prerequisites

Participants are expected to have some experience in computer programming and to be familiar with the basic concepts (e.g. variables, statements, control structures, functions) but previous knowledge of Julia is not required.

Timetable

Tuesday
09:00 60min Intro to Julia
10:00 10min Coffee break
10:10 50min Functions
11:00 10min Coffee break
11:10 50min Functions continued
12:00 30min Lunch break
12:30 40min Control flow
13:10 10min Coffee break
13:20 40min Packages and plotting
14:00 End of day
Wednesday
09:00 60min Strings and IO
10:00 10min Coffee break
10:10 50min Creating Packages
11:00 10min Coffee break
11:10 50min Creating Packages continued
12:00 30min Lunch break
12:30 40min Performance
13:10 10min Coffee break
13:20 40min Metaprogramming or vectorization
14:00 End of day

About the Materials

We recommend that you download these materials and run the Jupyter notebooks locally. See the instructions below. If you cannot run Julia locally, but you have an Aalto account, follow the instructions for the Aalto Jupyter.

The materials are a work in progress, so expect changes and don't be surprised if you discover a bug. If you find any problems, let us know by creating an issue

Lecture material can be read directly from GitHub using your browser. Just click yourself inside the notebooks directory. However, for best experience, you should open the notebooks in a notebook environment.

Cloning the materials

Downloading these materials is useful, since that allows you to make notes and run code directly in the notes. You can download the materials as a zip file or use your favorite git client to clone them from "https://github.com/AaltoRSE/julia-introduction.git".

Installing Julia

We recommend that you install Julia on you own laptop or work computer. This way it is easy to continue using Julia after the course.

First, download the current release of Julia. For more details see Julia's own installation instructions.

Windows: Run the installer. Then open the Julia application (double-click on it); a window with a julia> prompt will appear.

If you want to use WSL, check the instructions at the end.

MacOS: Open the dmg file and dragg the Julia app Applications. Run the application and a window with a julia> prompt will appear.

Linux: Open a terminal window and run the following commands to download and extract the necessary files:

wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.2-linux-x86_64.tar.gz
tar zxvf julia-1.6.2-linux-x86_64.tar.gz
export PATH="$PATH:~/julia-1.6.2/bin"

To use Julia later, you will need to add the following line to the .bashrc file in your home folder.

export PATH="$PATH:~/julia-1.6.2/bin"

All systems:

Start a Julia session. Install the IJulia package by pasting the following two:

using Pkg
Pkg.add("IJulia")

You may also want to install these packages, which we tend to use in a lot of the lecture materials

Pkg.add("Plots")
Pkg.add("PlotlyJS")
Pkg.add("PyPlot")

Then you can launch the notebook in your browser by running

using IJulia
notebook(dir=".")

The first time you run this, it will ask about installing Jupyter using conda. Answer 'y' and after a while, the notebook environment will open in the browser.

Using the Aalto Jupyter server

Aalto employees and students who have trouble installing Julia can also use the Jupyter Hub. Click on the link and sign in using your Aalto account.

To clone this repository on the Jupyter Hub, navigate to git -> Clone a Repository in the menu on the top of the page. Paste "https://github.com/AaltoRSE/julia-introduction.git" into the popup window and click CLONE.

Acknowledgements

These materials are based on the CSC course by the same name. We have modified both the structure and the content, so we are responsible for any mistakes.


References

Much of this material is based on different excellent content found around the web such as:

General topics

Parallellism:

Windows Subsystem Linux (WSL) installation steps

Install an X server. Xming0 is a good option. On Aalto laptops, you can find VcXsrv in the Software Center.

Run export DISPLAY=:0 and add it to the .bashrc file in your home directory.

Install a web browser using apt. For example, for firefox, run

sudo apt update
sudo apt upgrade
sudo apt install firefox

Then follow the Linux instructions.