Extending CPython (sub­inter­preter friendly!) a workshop with Marcel Plch

Sunday, 16 June, 14:00 in room EB226

Let's have a look on how to extend the Python interpreter from the low-level perspective. There are plenty of things you can do with Python using just C code and then just import it and call from your Python program.

For example, if you have a project that needs to do a lot of memory shuffling and processing power consuming computations, you might want to write that in a lower-level language like C. But it still is not worth to write the whole project in C, so you might want to just write an extension for this specific task and write the rest in Python.

The benefits of doing this are that you get a very fast, optimized machine code getting the most from your metal. The downside is a lot of headache.

Fun with pointers included.

This workshop is aimed at advanced Pythonistas. While it might be interesting for beginners we recommend them to choose another workshop.

Workshop will take 3 hours.

There will be maximum of 30 attendees.

Prerequisites

Good knowledge of Python and intermediate knowledge of C programming language. (Understanding of structures, pointers, memory allocation etc.)

Requirements

  • Text editor (heavy IDE's are discouraged, but probably possible to use)
  • Shell (or other way of invoking text editor python3, and gcc with arguments)
  • Python 3.6+ (newer is better!)
  • Python development headers (usually python(3)-dev(el) on most distributions)
  • Build essentials (gcc, standard libraries etc.)

Optional requirements (makes things a lot easier in case of problems):

  • gdb
  • git
  • Official Python repository cloned
  • Build dependencies of Python (# dnf builddep python3 in case of Fedora)
  • Favorite C libraries

We’re sorry but registration is not possible anymore.

Marcel Plch

I am a high school student and software engineer from Red Hat Python maintenance team in Brno.

In my free time, I like to learn new stuff and teach them to others. I also like to share skills that I consider a lot easier to gain when explained by someone else.

Besides Python, my favorite language is also C, which I like for its speed and simplicity (as in "simple in structure", rather than "simple to write").

I also like chatting about (mostly, but not just) computing and tech stuff, so feel free to stop by and have a word or two with me.

Dormouse759 Dormouse759

Check my talk What are CPython's sub­inter­preters?