Presentation and code for "Snake Oil"
The recording from EuroPython 2025 is available on YouTube.
A version of this demonstration was first given in October 2023 at BouvetOne and has since been expanded.
This version is more refined and polished and in English rather than Norwegian.
To run the mandelbrot program, you will need
miseto install and manage the runtimes used- A C compiler
- Windows
-
NOTE: To ensure relevant headers are installed, I would recommend including "Desktop development with C++" during the installation
-
- Linux
- macOS
- Windows
- CUDA Toolkit for the GPU example
- The demonstration was given using version 12.9 Update 1 for Windows
- Nvidia have more information on CUDA and Python
mise trust .
mise installTo run the demonstration, I recommend using uv (installed when using mise).
The main reason for that, is that some of the demonstration (e.g. Cython and Rust) requires compilation which uv is configured to handle "automagically".
uv run python -m mandelbrotNOTE: This will compile every implementation, which may take a little while.
If you want to use a single implementation, you may have to manually adjust pyproject.toml to remove the implementation(s) you don't want to use.
Part of the demonstration uses Cython with OpenMP for parallelization.
macOS' LLVM toolchain does not support -fopenmp, so we use Homebrew's LLVM toolchain instead.
brew install llvm
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++sudo apt-get install -y libpomp-devAssuming a virtual environment is set up, running the demonstration can be done by executing
pip install -e .
python3 -m mandelbrotThis will (likely) use pre-compiled packages of the various implementations, which are available on PyPi.
Since pygame-ce is currently only pre-compiled for CPython, it will be compiled from source on other implementations of Python.
You will need to install the necessary dependencies as described for Linux, macOS, or Windows on pygame-ce's wiki.
The slides use Reveal.js and vite for building / bundling.
To show them locally, run
cd src/presentation
corepack enable # not necessary if using mise
yarn install
yarn startThey are also served via GitHub Pages.