Julia

Julia is a high-performance language for scientific computing, which also happens to be readable. Julia may be the best choice for our work, though there may be times when your collaborators want to use Python or R, or when tools already exist in those languages that are perfect for a particular project.

Installation

Use juliaup to manage Julia installations. This will let you seamlessly switch between versions across different projects and install new versions.

Usage

If you’re coming from MATLAB or Python, here is a useful cheatsheet for translating common operations into Julia. Otherwise, if you’ve taken BEE 4750 or 4850 with Vivek, you’ve gotten an introduction to Julia.

Development Environments

VS Code is the editor of choice for Julia. The Julia extension turns VS Code into a full-fledged Julia development environment.

Package Management

Julia comes with a fantastic package manager, Pkg.jl. Make sure you make a new environment for each project (which means each project should have a unique Project.toml and Manifest.toml).

Learn More

A good introduction to Julia is Introduction to Computational Thinking, an online course from MIT.

When You’re Stuck

Julia’s ecosystem is smaller than Python’s, so the search-engine reflex works less well and the official channels work better.

  1. Docstrings at the REPL. ?functionname is fast and unusually complete. @which f(x) tells you which method is being called, which is the key question when dispatch is not doing what you expect.
  2. The Julia manual, particularly Performance Tips when code is slower than you expected. Type instability is the usual culprit; @code_warntype finds it.
  3. Julia Discourse is the main place questions get answered, and answers frequently come from the package authors. Better signal than Stack Overflow for Julia specifically.
  4. The package’s GitHub issues. Smaller ecosystem means a real chance your problem is a known issue or a recent breaking change.
  5. Check your environment. ] status in the REPL. Version mismatches between a Project.toml and what is actually installed cause a lot of confusing behaviour.
  6. Modern Julia Workflows for how to set things up sensibly in the first place.