This repository contains the content for the Introduction to Julia course by Aalto SciComp. Online lecture recordings can be found here at YouTube.
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!
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.
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.
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 its github repository.
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.
Change the julia executable to which the command julia
points:
- System environment variable (if you install Julia for all users):
"Control Panel\All Control Panel Items\System --> Advanced system settings --> Advanced --> Environmental Variables --> Edit in
Path
"- under "User variables for
administrator_username
" only for the administrator, under "System variables" for all users)
- under "User variables for
- User environment variable (if you install Julia for the current user):
Search
environment variables
in the Windows taskbar --> "Edit environment variable for your account" --> Edit inPath
under "User variables forthe_current_username
" - Edit in
Path
: ClickNew
to addX:\directory\to\Julia-x.x.x\bin
and delete the directory for old versions
Check environment variables: In Command Prompt
type path
. In normal mode, it shows the variables for the user, and in administrator mode the system variables.
If you want to use WSL, check the instructions at the end.
Work with jupyter notebook:
Start a Julia session.
Install the IJulia
package by pasting the following two:
using Pkg
Pkg.add("IJulia")
Renew the julia kernel in notebook
using Pkg
Pkg.update()
Pkg.build("IJulia")
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.
Option 1: use Conda.jl package.
Option 2: general approach of conda environment management
- Activate conda command in pwsh, or use
Anaconda Prompt
directly - Check all info of conda: "
conda info
" - Check existing conda environments: "
conda info --env
" or "conda env list
" - Switch between conda envs: "
(conda) activate\deactivate path/to/env
" - Switch to the conda environment used by Julia
- Update conda and all packages:
conda update conda
conda update --all
- Update the python: "
conda update python
" For more info, also see manage conda environment, manage conda python, and conda cheatsheet.
- In
Anaconda (Powershell) Prompt
, execute
conda init powershell
- For more info, see here
- This would enable automatic activation of conda 'base' environment in the pwsh. To prevent this, execute
conda config --set auto_activate_base false
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.
Much of this material is based on different excellent content found around the web such as:
- Julialang.org
- Official Julia manual: https://docs.julialang.org/en/latest/manual/
- JuliaBox.com and the excellent tutorials therein
- https://en.wikibooks.org/wiki/Introducing_Julia
- Introduction to python course at CSC
- https://slides.com/valentinchuravy/julia-parallelism
- MIT course: Performance Computing in a High Level Language: https://github.com/stevengj/18S096
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.