Introduction to Julia#
Course Description#
Welcome to the Introduction to Julia course! This course has been created to give you an idea of Julia’s particular language features. It assumes you are already comfortable with the basics of programming, allowing for more detailed and interesting topics to be discussed. To be able to best engage with this course, it is therefore recommended that you are familiar with the content in both “Introduction to Python” and “Python for Data Analysis”.
Course Objectives#
Understand Julia’s design philosophy and interact fluently with its REPL, including both the package and help modes.
Define and manipulate basic data types and variables, and apply control-flow constructs (
if
,for
,while
) to express algorithmic logic.Encapsulate functionality in Julia functions, leveraging multiple dispatch to write clean, type-specific methods.
Work with arrays and matrices, perform element-wise and linear algebra operations, and harness Julia’s native array abstractions for efficient numerical computing.
Read from and write to external data sources using Julia’s I/O facilities, and parse or format data in common file formats.
Create informative visualisations of data and simulation output with
Plots.jl
(and other graphics packages).Manage project dependencies and packages using Julia’s built-in package manager (
Pkg
), and organise your code into multi-file, reproducible projects.Diagnose and eliminate performance bottlenecks by profiling your code.
Apply your skills to a capstone project, implementing and optimizing Conway’s Game of Life from first principles, and extending it with custom rules, GUIs, or advanced visualizations.
Pre-requisite Knowledge#
This course assumes prior programming experience and a comfort with fundamental programming concepts (variables, if statements, for/while loops, functions, errors), as gained from programming in another language. The course is not designed as a course for learning your first programming language.
Sign-up#
To check for upcoming course dates and to register, please visit the Workshop Schedule and Sign-up page available here.
Installation Guide#
All CfRR courses require attendees to use their own computer/laptop to follow workshop activities and take effective notes.
If you are new to Julia then the recomened method of using Julia for this course is with JupyterLab. You can follow the instructions within Introduction to Python to install JupyterLab.
To install Julia on your laptop, you will want to follow the commands below, depending on what OS you are using.
Installation Guide#
All CfRR courses require attendees to use their own computer/laptop to follow workshop activities and take effective notes.
Follow the steps below for your platform to get Julia up and running. The best way to install and manage Julia on your system is via the official juliaup
tool.
Install Julia#
Windows#
Install Julia by running this in the command prompt:
winget install --name Julia --id 9NJNWW8PVKMN -e -s msstore
macOS and Linux#
Install Julia by running this in the terminal:
curl -fsSL https://install.julialang.org | sh
These commands will fetch and install juliaup
, then download the current stable Julia release.
Verify your installation#
After installation completes, close and reopen your terminal (or PowerShell), then check:
juliaup status
julia --version
Where you should see the version of Julia that has been installed printed.
Adding a Julia Kernel to JupyterLab#
Add Julia to JupyterLab Within the Julia REPL, run the following command to add Julia as a kernel to JupyterLab:
import Pkg; Pkg.add("IJulia"); Pkg.build("IJulia"); using IJulia; installkernel("Julia")
You can enter the Julia REPL by entering julia
on your terminal / command line / PowerSheel etc.
You should now see Julia
available alongside Python in the top-right kernel picker.
Self Study Material Link#
The self-study material for this course is available here.
Developers#
This course was developed by Liam Berrisford and Tom Hawes. This course is based on the official Julia documentation.
License Info#
Instructional Material
The instructional material in this course is copyright © 2024 University of Exeter and is made available under the Creative Commons Attribution 4.0 International licence (https://creativecommons.org/licenses/by/4.0/). Instructional material consists of material that is contained within the “individual_modules/introduction_to_julia” directory, and images folders in this directory, with the exception of code snippets and example programs found in files within these folders. Such code snippets and example programs are considered software for the purposes of this licence.
Software
Except where otherwise noted, software provided in this repository is made available under the MIT licence (https://opensource.org/licenses/MIT).
Copyright © 2024 University of Exeter
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The software in this repository is adapted from software that is covered by the following copyright and permission notice:
Copyright © 2024 Software Carpentry
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.