Part I: Introduction to Julia
Introduction
- Julia is a just-in-time compiled language
- Julia packages compose well
- Designed for science and engineering
Using the REPL
- The REPL will
- Read the given input
- Evaluate the given expression
- Print the result to the user
- Loop back to the prompt again
- Pressing ? enters help mode.
- Pressing ; enters shell mode.
- Pressing ] enters pkg mode.
- To exit shell, help or pkg mode, hit backspace.
The Julia Type System
- In Julia types have only one direct supertype.
Using the Package Manager
- Find packages on JuliaHub
- add packages using
pkg> add - use many small environments rather than one big environment
Part II: Programming in Julia
Write functions!
- You can think of functions being a collection of methods
- Methods are defined by their signature
- The signature is defined by the number of arguments, their order and their type
- Keep the number of positional arguments low
- Macros transform Julia expressions
Interfaces & conditionals
- Conditions use
if,elseif,elseandend - Interfaces are informal
- Interfaces facilitate code reuse
Loops
- Use for loops for a known number of iterations and while loops for an unknown number of iterations.
Part III: Managing Julia Projects
Using Modules
- Modules introduce namespaces
- Public API has to be documented and can be exported
Creating Packages
- The general registry is hosted on GitHub.
- Packaging is easy
Adding tests
- Tests are important