Speeding up Python code has traditionally been achieved by writing C/C++ — an alien world for most Python users. Today, you can write high performance code in Julia instead, which is much much easier for Python users. This tutorial will give you hands-on experience writing a Python library that incorporates Julia for performance optimization.
Julia is a modern data science language which solves the two-language problem by being both easy to use and high performant. Although different from Python, the language can be quickly learned by Python users, making it a good choice for speeding up pieces of code. Julia, in addition to being a similar language, is designed for high-performance applied mathematics and has high-quality libraries for multi-dimensional arrays, dataframes, distributed computing and more.
The older alternative of writing pieces of code in C, C++, Cython or Rust is much more cumbersome: Here, programmers have to cope with a low-level language, static types, pointers, no garbage collector, lack of scientific libraries and other difficulties not normally faced by Python users. There was simply no better alternative.
The tutorial will be fully hands-on, using Jupyter Notebook and Binder to provide a smooth and easy-to-use environment for each participant. Both Julia and Python work seamlessly within Jupyter. We start with an introduction to the basics of Julia, focusing on the core differences with Python and how to work around common translation difficulties. Then we'll take a look at the interfaces between Julia and Python and build a Python sample project that runs Julia code. Finally, we will benchmark our solution.
After the tutorial you will be able to use Julia to speed up your Python code.