Upgrade to Pro — share decks privately, control downloads, hide ads and more …

It's turtles all the way down

It's turtles all the way down

The title refers the fact that one of Julia's main strengths is that it is (almost entirely) written in Julia and so empowers the developers to create code without leaving their programming expertise.

Avatar for Malcolm Sherrington

Malcolm Sherrington

January 27, 2015
Tweet

More Decks by Malcolm Sherrington

Other Decks in Programming

Transcript

  1. Some questions to answer ! Why use Julia when R

    and Python just suit me fine? ! The Goldilocks dilemma: 
 Is it too soon or just right? ! How do I start and what support can I expect? ! What work has been done and what will happen next?
 

  2. Data Science – A basket case ? ! A toolkit

    and set of methodologies to enable the analyst to work with data ! Wide variety of disciplines ! Approach as a quant, statistician, big-data analyst very different ! Wish to map pseudo code to the language ! And avoid the “two” language problem. ! Non-vectorised code can be very slow
  3. What makes a good Data Science Language? ! General purpose

    language with a sizable user community ! A good set of general purpose libraries ! Be free, open-source and platform independent. ! Be fast and efficient. ! Have a strong type system, and be statically typed with good compile-time type checking and type safety. ! Have reasonable type inference. ! Have a REPL for interactive use
  4. The usual “suspects” ! Matlab / Octave ! R !

    Python ! Scala ( / Clojure ?) ! Julia
  5. History ! Original development team (G4): – Jeff Bezanson, Stefan

    Karpinski – Viral Shah, Alan Edelman ! Started at MIT in 2010 ! First release February, 2012 ! Still actively maintained by G4 ! MIT/Stanford/Columbia and many others in USA are using Julia in courses
  6. (Some of) Julia's features 1. Written in Julia 2. Multiple

    dispatch 3. Homoiconic (macros) 4. LLVM / JIT-tered 5. Parallelism built-in 6. Interoperability with other code
  7. T = 100; # Number of time steps N =

    1000000; # Number of trials dt = tma/T; # Timestep P = zeros(Float64,N); S = zeros(Float64,T); for i = 1:N dW = randn(T)*sqrt(dt); S[1] = S0; [ S[t] = S[t-1] * (1 + (r - q - 0.5*v*v)*dt + v*dW[t] + 0.5*v*v*dW[t]*dW[t]) for t=2:T ]; P[i] = mean(S); end [ P[i] = max(P[i] - K, 0) for i = 1,N ]; AsianPrice = exp(-r*tma)*mean(P); println("Option price = $AsianPrice");
  8. Benchmarks for Asian option Language Timing (c = 1) Asian

    Option c 1.0 1.681 julia 1.41 1.680 python (v3) 32.67 1.671 R 154.3 1.646 Octave 789.3 1.632 Results for 100,000 runs of 100 steps, (c ~ 0.73 s) Samsung RV711 laptop with an i5 processor and 4Gb RAM running Centos 6.5 (Final)
  9. What makes Julia special? ! It is written in Julia

    - apart from a small core - and the code is available to look at. ! The designers are data scientists and not tied to companies such as Google (Go) or Mozilla (Rust). ! It eliminates the two-language problem. ! It has been designed for parallelism / distributed computation. ! It takes every opportunity to cooperate rather than confront. ! Julia intends to combine the best from MATLAB, R and Python, to be consistent, well designed and fast.
  10. Myths ! Julia is all about speed ! Julia can't

    do graphics ! Julia is not good for statistics ! Julia is a language for geeks ! Julia is not ready for the Enterprise
  11. Julia for Data Scientists ! Julia makes no distinction between

    analysts, developers and programmers ! Packages are grouped: JuliaStats, JuliaWeb ! Julia maps analytics to coding seemlessly ! Easy to call functions in foreign libraries ! Julia can read and write R datafiles ! Common functionality is in Base or Packages