Introduction to Julia

Carlos Castillo Passi, PhD

10 Jan 2025

Who am I

  • I have been using Julia since 2014 (Julia 0.3.0), and I fell in love with the language.

Who am I

  • During my PhD: KomaMRI.jl, GPU accelerated MRI simulations (120+ stars and 1k+ downloads)
  • Active member of JuliaHealth organization

Julia is fast

Julia is one of the fastest programming languages per lines of code.

Julia is fast

Julia is fast

  • High performing Julia cose is not very different
  • Naive code: 5-8 times faster than Python, 2x slower than C++
  • Optimized code is on par with C++

Two language problem

Two language problem

In Julia you can gradually learn and improve

Julia is compiled

What does this mean?

  • First time the code runs it is compiled (Just In Time (JIT) compiled)

      - `@time f(x) # warmup` 
      - `@time f(x)`
  • We think that vectorized code is fast … but that is just because overhead

  • For loops are not slow, you are free!!

Julia is interactive

  • Run functions in julia>
  • Help mode?: help?> cis and help?> "Euler"
  • Package mode ]: We will talk more about it in Part 2
  • Shell mode ;: Execute shell commands

Pakage manager

  • One of the best in the game
  • Reproducible (Project.toml, and Manifest.toml)

Comparison with Python

Goal of this workwshop

Let’s start our journey

Multiple dispatch

Multiple dispatch

Multiple dispatch

Multiple dispatch

Multiple dispatch