Skip to content

Instantly share code, notes, and snippets.

View brianwisti's full-sized avatar

Brian Wisti brianwisti

View GitHub Profile
---
# Settings for clean markdown on Random Geekery
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
#
# Some rules override others, but I'm not sure which.
default: True
# MD001: heading-increment
MD001: True
@brianwisti
brianwisti / count_primes.py
Created May 1, 2025 18:07
Prime sieve comparison in plain Python, Numba, and Taichi
"""
Count the prime numbers in the range [1, n].
Comparing the same code in pure python, Numba, and Taichi. This is the sort
of thing that happens when I have coffee and time on my hands.
while looking at the `taichi docs`_.
.. _Taichi docs: https://docs.taichi-lang.org/docs/accelerate_python