Julia is a dynamic language for scientific and numerical computing that compiles to fast machine code. It aims to remove the split between the prototyping language and the fast one: you write readable, high-level code and it runs at speeds close to C. Its design centres on multiple dispatch and a strong numerical library.
Key concepts
- Just-in-time compilation: functions are compiled to machine code on first call for the types they receive.
- Multiple dispatch: the method that runs is chosen from the types of all arguments, the central organising idea.
- Type stability: code whose result type depends only on input types is what the compiler can make fast.
- Arrays and broadcasting: built-in n-dimensional arrays and dotted syntax that applies functions elementwise.
- Composability: packages written independently work together through shared types and dispatch.
- Metaprogramming: macros and code that generates code.
Vocabulary
- Method: one specialisation of a function for specific argument types.
- Broadcast: applying a function across arrays with the dot syntax.
- Package environment: a project-specific set of dependencies recorded in files.
- Latency on first call: the compile delay the first time a function runs.
What to study, in order
- Basic syntax, arrays, functions and the REPL, writing small numerical scripts.
- Types, structs and multiple dispatch; define your own type with arithmetic methods.
- Performance basics: type stability, avoiding global variables, and benchmarking.
- Package environments and plotting or data libraries for your field.
- Solve a numerical problem you know, such as a differential equation, and compare with another language.
- Read the manual's section on performance tips.
Related tags
#numerical-analysis #data-science #computational-science #hpc