Julia and Python: a dynamic duo for scientific computing; SciPy 2013 Presentation
Authors: Bezanson, Jeff, MIT; Karpinski, Stefan, MIT
Julia is a recent addition to the collection of tools a scientist has available for tackling computational problems. It combines the simple programming model of a dynamic language like Python with the performance of a compiled language, while exposing expressive high-level features such as a sophisticated type system, dynamic multiple dispatch, Lisp-style macros and metaprogramming.
Julia can natively make zero-overhead calls to C and Fortran libraries without wrappers or data copying. Moreover, Julia can now call Python as well , with automatic bidirectional type conversion, bidirectional callbacks, and copy-free sharing of lists, dictionaries, and NumPy arrays. This is as simple as:
julia[HTML REMOVED] using PyCall julia[HTML REMOVED] @pyimport scipy.optimize as so julia[HTML REMOVED] so.newton(x-[HTML REMOVED]cos(x)-x, 1) 0.7390851332151607 Conversely, Python code can dynamically load the Julia runtime library and execute arbitrary Julia code. We have exploited this possibility to run Julia within the IPython environment :
In : %load_ext juliamagic In : jfib = %julia fib(n) = n [HTML REMOVED] 2 ? n : fib(n-1) + fib(n-2) Out: [HTML REMOVED]PyCall.jlwrap fib[HTML REMOVED] In : jfib(20) Out: 6765 In this talk we'll give an introduction to the Julia language and demonstrate how you can use Julia where it makes sense for you, while continuing to use your favorite scientific libraries and existing Python and C code.