Skip to content

sindre-nistad/snake-oil

Repository files navigation

Snake Oil

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.

Setup

Demonstration

To run the mandelbrot program, you will need

  • mise to install and manage the runtimes used
  • A C compiler
    • Windows
      • Visual Studio Community 2022

        NOTE: To ensure relevant headers are installed, I would recommend including "Desktop development with C++" during the installation

    • Linux
    • macOS
      • llvm

        NOTE: The Cython example uses OpenMP for parallelization which is not supported on the version of Clang Apple ships with the OS.

        Instead, use Homebrew's LLVM; brew install llvm and

        export CC=$(brew --prefix llvm)/bin/clang
        export CXX=$(brew --prefix llvm)/bin/clang++
  • CUDA Toolkit for the GPU example
mise trust .
mise install

To 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 mandelbrot

NOTE: 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.

macOS

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++

Debian

sudo apt-get install -y libpomp-dev

Using pip

Assuming a virtual environment is set up, running the demonstration can be done by executing

pip install -e .
python3 -m mandelbrot

This will (likely) use pre-compiled packages of the various implementations, which are available on PyPi.

Non-CPython implementations

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.

Presentation

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 start

They are also served via GitHub Pages.

About

Presentation and code for "Snake Oil"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors