Skip to content
Tutorials Center
My learning

Topics

Julia Tutorial

Learn Julia step by step: 40 lessons in 12 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Julia? Learn what the Julia programming language is, why it was created, how its JIT compiler removes the two-language problem and where Julia is used today.
  2. 2 Installing Julia and Using the REPL Install Julia with juliaup, learn the four REPL modes (julia>, help?>, shell> and pkg>), run script files and set up VS Code or a notebook.
  3. 3 Your First Julia Program Write your first Julia program: print with println, add comments, create variables, build strings with interpolation and meet 1-based indexing.

Basics

  1. 4 Numbers and Math Learn Julia numeric types: Int64, Float64, Rational, Complex and BigInt, literals, division with div and rem, integer overflow and the ^ and .^ operators.
  2. 5 Strings and Characters Learn Julia strings and chars: String vs Char, byte-based indexing, interpolation, join, split, replace, regular expressions and Unicode handling.
  3. 6 Control Flow Learn Julia control flow: if/elseif/else, the ternary operator, short-circuit evaluation, for and while loops, break, continue, ranges and begin blocks.
  4. 7 Functions Learn Julia functions: long and short form, multiple return values, optional and keyword arguments, anonymous functions, do blocks and the ! naming convention.

Collections

  1. 8 Arrays and Vectors Learn Julia arrays: 1-based indexing, push!, slicing, ranges, comprehensions, views versus copies and column-major memory order, with NumPy stand-ins.
  2. 9 Matrices and Linear Algebra Learn Julia matrices and the LinearAlgebra standard library: matrix literals, A*B, transpose, the backslash solver, determinants and eigenvalues, with NumPy.
  3. 10 Broadcasting and the Dot Syntax Understand Julia broadcasting: dot calls on any function, fused loops with @., in-place broadcast!, shape rules and how it differs from NumPy vectorization.
  4. 11 Tuples and Named Tuples Learn Julia tuples and named tuples: immutability, destructuring, splatting into function calls, keyword arguments from NamedTuple, with Python stand-ins.
  5. 12 Dictionaries and Sets Learn Julia dictionaries and sets: Dict creation, pairs, get, haskey, iteration order, union, intersect and setdiff, with runnable Python stand-ins.

Types and Dispatch

  1. 13 The Type System Understand Julia's type system: abstract and concrete types, the type hierarchy, typeof, isa, subtyping with <:, Union types and the special type Any.
  2. 14 Structs and Custom Types Define your own Julia types with struct and mutable struct, write outer and inner constructors, customize show, and use Base.@kwdef for keyword defaults.
  3. 15 Multiple Dispatch Learn Julia's core idea, multiple dispatch: functions with many methods, choosing by every argument, ambiguity errors, and extending existing functions.
  4. 16 Parametric Types and Generic Code Write generic Julia code with parametric types, where clauses and type parameters, understand invariance and Vector{T}, and rely on duck typing safely.
  5. 17 Interfaces and Iteration Protocols Learn how Julia interfaces work without interface keywords: implement iterate, length and getindex, extend Base methods, and design abstract type contracts.

Modules and Packages

  1. 18 Modules and Scope Organize Julia code with modules, learn the difference between using and import, export names, and master global and local scope, let blocks and closures.
  2. 19 Packages and Environments Use Julia's built-in package manager: add packages, read Project.toml and Manifest.toml, activate environments, share reproducible setups and create your own package.

Performance

  1. 20 How Julia Compiles Code See how Julia's just-in-time compiler specializes methods on argument types, why the first call is slow, and how to inspect the result with @code_warntype.
  2. 21 Performance Tips Make Julia code fast: keep functions type stable, avoid global variables, preallocate, use views and in-place functions, loop in column-major order and benchmark properly.
  3. 22 Threads, Tasks and Distributed Computing Run Julia code in parallel: Threads.@threads, tasks and channels, atomics and locks to avoid race conditions, Distributed processes and a short GPU overview.

Metaprogramming

  1. 23 Macros and Metaprogramming Learn how Julia code is data: build and inspect Expr trees, use quote and interpolation, write hygienic macros with esc, and see how @time and @assert work.

Errors and I/O

  1. 24 Errors and Exceptions Handle failure in Julia: read common error messages, use throw, error and @assert, catch exceptions with try/catch/finally, define custom exception types.
  2. 25 Files and I/O Read and write files in Julia: open with do blocks, read and readlines, append mode, IOBuffer, path helpers, and CSV files through packages.

Data and Science

  1. 26 DataFrames.jl Work with tables in Julia using DataFrames.jl: build, select, filter, sort, groupby and combine, join, handle missing data, and compare with pandas.
  2. 27 Plotting Make line, scatter and bar plots in Julia with Plots.jl and Makie: labels, legends, multiple series, subplots, saving figures, and the first-plot delay.
  3. 28 Differential Equations and Optimization Solve ODEs with DifferentialEquations.jl, formulate linear programs with JuMP, and minimize functions with Optim.jl, with Python stand-ins you can run.
  4. 29 Random Numbers and Statistics Generate random numbers with rand and randn, set seeds for repeatable results, summarize data with Statistics, and use Distributions.jl, with NumPy stand-ins.

Testing and Tooling

  1. 30 Testing with Test.jl Write tests in Julia with the Test standard library: @test, @testset, @test_throws, approximate equality, test files for packages, and continuous integration.
  2. 31 Debugging and Profiling Find bugs and slow code in Julia: Revise for fast reloads, Infiltrator and Debugger for stepping, @profile and flame graphs, and tracking allocations.
  3. 32 Calling Python, C and R Use code from C, Python and R inside Julia: ccall and shared libraries, PythonCall.jl, RCall.jl, type conversion, array layout, and common pitfalls.

Projects

  1. 33 Project: Numerical Simulation Build two numerical simulations in Julia, a heat equation with broadcasting and an n-body orbit with structs, then check them against a runnable NumPy port.
  2. 34 Project: A Data Analysis Pipeline Build a small Julia data pipeline: read a CSV, clean missing values, compute revenue, group and summarize with DataFrames.jl, and plot, with a pandas port.
  3. 35 Project: A Small Generic Package Build a small Julia package from scratch: parametric types, multiple dispatch, constructors, a test suite, docstrings and docs, and how to share it.
  4. 36 Project: Monte Carlo Estimation Estimate pi and price a stock option with Monte Carlo simulation in Julia: random numbers, standard error, variance reduction and multi-threading.

Practice and Review

  1. 37 Practice Exercises with Solutions Fifteen Julia exercises on arrays, broadcasting, dispatch, structs, iteration and performance, each with a worked solution and a runnable Python stand-in.
  2. 38 Common Mistakes and Gotchas The Julia mistakes that cost beginners the most time: slow globals, 1-based indexing, loop order, type instability, aliasing, and Python and MATLAB habits.
  3. 39 Julia Interview Questions Twenty-two Julia interview questions with model answers: multiple dispatch, type stability, JIT compilation, macros, packages, concurrency and performance.
  4. 40 Julia Cheat Sheet A one-page Julia cheat sheet: syntax, collections, strings, types, multiple dispatch, broadcasting, performance rules and Pkg commands with short examples.