Help us!

Take some time to transcribe PyCon 2014 talks! Click on the "Share" button below the video and then "Subtitle" to get started.

Julia and Python: a dynamic duo for scientific computing; SciPy 2013 Presentation

Summary

Authors: Bezanson, Jeff, MIT; Karpinski, Stefan, MIT

Track: General

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 [3], 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 [4]:

In [1]: %load_ext juliamagic In [2]: jfib = %julia fib(n) = n [HTML REMOVED] 2 ? n : fib(n-1) + fib(n-2) Out[2]: [HTML REMOVED]PyCall.jlwrap fib[HTML REMOVED] In [3]: jfib(20) Out[3]: 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.