Julia for Python Developers

If you’re a long-time python developer, an hour should be all the time you need to get up to speed with julia too. Here are notes that I’ve used to onboard python coders in the past (I may fill in more details over time).

  • REPL
    • ? (-> docstrings)
    • Tab-completion (-> Unicode)
  • end vs indentation
  • JIT compilation
  • Types
    • Abstract, e.g. Integer
    • (mutable) Composite, e.g. Int64
    • many more…
    • -> Type stability for performance
  • Multiple Dispatch vs Member Functions
    • Advantages:
      • dispatch on all arguments
      • no ambiguity (cmp. numpy.save("fn",nparr) – why not nparr.save("fn"))
    • methods typically 3-10 lines
    • operators are functions
  • Vectorized Operators, e.g. .*, vs numpy *-confusion
  • String Interpolation, Concatenation by * not +
  • r"...", etc.
  • 1-Idea-1-Line
    • lambda
    • ;
    • |>
    • &&
  • 1-based indexing
    • julia: 1:N, N+1:end
    • python: 0:N, N: (confusing: is N included in the first list? Is it in the second?)
  • Modules
  • Parametric and Metaprogramming, Introspection, Reflection

Leave a Reply

Your email address will not be published. Required fields are marked *