06-05, 13:00–16:30 (UTC), Room 2
Python is known for its ability to interoperate with other languages. We will learn how to call C from Python using CFFI, Ctypes, Cython, and others
The workshop is based on the jupyter notebook avaiable here. You will want to make sure you have an appropriate python3 environment ready, including cppyy which can be installed via pip.
Starting from a simple pure-python program to produce a Mandlebrot fractal image, we will learn how to:
-
Benchmark and profile python performance
-
Write the time-critical code in C
-
Call the c code from Python using CFFI, Ctypes, Cython, and if time allows CPPYY and PyBind11.
-
Compare and contrast the methods: ease of use, maintainability, speed and popularity
At the end we will discuss other solutions for making the pure-python version fast.
Matti is a core developer of PyPy, contributing to the internal numpy implementation _micronumpy and to the layer that allows python c-extension modules to run on the PyPy python interpreter. He has been active in the open source community both as a contributor and teacher. He now works full-time on Numpy at BIDS.