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 community is smaller than Python’s, so web searches turn up less, and the official documentation and forums are more useful. Try these in order:
- Read the docstring at the REPL with
?functionname. Julia’s docstrings are usually thorough. If a function isn’t doing what you expect,@which f(x)shows which method is being called. - Read the Julia manual, and Performance Tips in particular when code is slower than you expected. Type instability is a common cause, and
@code_warntypeshows where it happens. - Search or ask on Julia Discourse, where most Julia questions are answered, often by the authors of the package involved. For Julia, it is more useful than Stack Overflow.
- Check the package’s GitHub issues. With fewer users, there is a good chance your problem is a known issue or the result of a recent breaking change.
- Check your environment with
] statusat the REPL. A mismatch between the versions inProject.tomland what is installed causes a lot of confusing behavior. - Read Modern Julia Workflows for how to set up a project well from the start.