Skip to the content ForoHackers
Log inJoin

Julia: start here

Julia
#3085 · · Quote · Report

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

  1. Basic syntax, arrays, functions and the REPL, writing small numerical scripts.
  2. Types, structs and multiple dispatch; define your own type with arithmetic methods.
  3. Performance basics: type stability, avoiding global variables, and benchmarking.
  4. Package environments and plotting or data libraries for your field.
  5. Solve a numerical problem you know, such as a differential equation, and compare with another language.
  6. Read the manual's section on performance tips.

Related tags

#numerical-analysis #data-science #computational-science #hpc

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply