This website contains a series of notebooks illustrating the use of the Julia programming language. It was originally designed as teaching material for students of École des Ponts ParisTech, but it is accessible to a much wider audience.
All of the links in the menu point to notebooks that can be visualized in your browser without any prerequisites. To edit or run a notebook, click on
Edit or run this notebook and follow the instructions given there. You will need to install Julia and add the Pluto package. I sometimes had issues with Pluto in Firefox, so you may want to try Google Chrome.
While these notebooks are great for interactive exploration of short code snippets, they have serious downsides when it comes to larger tasks. We strongly advise you to choose another tool for more ambitious projects, ideally an IDE such as VSCode (more on this below).
What is Julia?
Maybe the solution to the two-language problem (see this Nature article):
- User-friendly syntax for high-level programming
- C-level speed (when done right) for high-performance computing
If you want to go further, here is a list of quality books and tutorials:
Beyond the present website, other students from my own research lab have also worked on interactive tutorials, which you will find below:
When coding in Julia, you want to select a comfortable IDE. Here are a few good choices:
- VSCode with the Julia for VSCode extension
- Atom with the Juno package
- Any other IDE with the relevant Julia support
- Jupyter Lab is a browser-based IDE for Julia, Python and R
- Pluto is a Julia-based reactive notebook server, and the one we use for this course
The Julia community is very active and welcoming, so don’t hesitate to ask for help in the following venues:
- a quick Google search
- the Humans of Julia Discord
- the Julia Slack
- the Julia discourse forum
- a specific package’s GitHub repository, which includes documentation and issues
Creating a package
Before coding something, you want to make sure that someone else hasn’t already coded it better and faster than you. Since Julia package names are sometimes obscure, you may need to search for packages on a dedicated database: that’s what JuliaObserver and JuliaHub are here for.
In addition, Julia packages are often gathered into GitHub “groups” or organizations, which are listed here.
If a Julia package doesn’t exist:
- Look for it in C and use the built-in C callers
- Look for it in Python and use PyCall.jl
- (you get the idea)
…or code / wrap it yourself in Julia and contribute to the community!
Some workflow tips can be found in the manual. In particular, you should check out the following packages:
- Revise.jl: incorporate changes without restarting the REPL
- Debugger.jl: dynamically debug source code (much easier to use from within VSCode)
- JET.jl: statically debug source code
- JuliaFormatter.jl and its VSCode extension: format source code
The PkgTemplates.jl package enables you to create packages in a standardized way. It takes care of the file structure for you, and even integerates with GitHub Actions or Travis CI to set up a continuous integration workflow.
Julia has no universally agreed-upon style guide like Python. The main official guidelines can be found here.
For an exhaustive style reference, have a look at the unofficial (but widely used) BlueStyle by Invenia.
Julia has built-in support for unit testing. This allows you to check that recent modifications did not modify the expected behavior of your code.
If you are courageous enough to write documentation (which you should be), the best place to put it is next to your code using docstrings. Julia docstrings are basically Markdown, see this reference to know how to write them.
If you want to automatically generate a nice HTML documentation website, harnessing the power of Documenter.jl is the way to go. This pakcage also enables testing from within the documentation itself. Inside a docstring, you can put examples of REPL input and expected output, which will be run again and checked for correctness every time the documentation is updated. These code examples are called doctests.