Other #PyConUS sprints this week:

* #RAPIDSai
* django-simple-deploy and py-bugger
* #PyFyre, #MyPy, and #MyPyC
* MemRay
* #Ruff or Ty from Astral
* #WheelNext
* ci-test / linting-arguments-python

Additionally there will be an "Introduction to Sprints" open space in Room 310 at 6:00 PM.

#PyConUS2025

#ty #mypy - but mypy already compiles itself to c via #mypyc so being faster isn't what I'd be expecting, it will be different and probably find different typing errors since for all the type checkers, it comes down to a matter of opinion. Do you think that will be a runtime error? That's in the future, who knows man.

@isaaclyman
That's pretty much how #Python optimizing compilers like #cython, #mypyc, #numba, and #TaichiLang work, and iiuc is the idea behind #MOJOlang.

As for leaky abstractions, I'd mitigate that by moving the lower-level algorithms into a separate module and limit the optimization pass to that module. Higher-level modules, like CLI entry points or API server route handlers, shouldn't need the extra optimization.

Here is an example of how I used #cibuildwheel with #mypyc (which in theory can compile to C anything that you can perfectly type annotate)

https://github.com/matthewdeanmartin/untruncate_json/blob/main/cibuildwheel.toml

untruncate_json/cibuildwheel.toml at main · matthewdeanmartin/untruncate_json

Python library to repair truncated json. Translated directly from the typescript original version - matthewdeanmartin/untruncate_json

GitHub

So if I take ordinary #python (no math to speak of) and

#cythonize it
#mypyc it

No obvious pattern on if it is faster or not. I don't know where the 20% to 200x rule of thumb came from (that I've seen in various conference talks)

I've been trying every x months to speed up #python with native code. This weekend with half-assed effort I got a rust + python thing going.

The magic: #maturin + #pyo3

- c, go, c++, #cython - failed because the difficult level of dealing with the build scripts. And c, c++ are just nasty.
- #mypyc - Almost worked, but failed, the annotations have to be a perfect subset of what mypyc can handle.

Mypyc and cython need something like maturin if they want get widespread adoption.

People out here sleepin' on mypyc.

http://mypyc.readthedocs.io/

#Python #mypy #mypyc

mypyc 1.5.0+dev.cab8c674ebef944498ae4e9a89cd9c77316656ec.dirty documentation

You Should Compile Your Python And Here’s Why

write Python that’s faster than C by optimizing your code, adding standard type annotations, and using Mypyc.

You Should Compile Your Python And Here’s Why

write Python that’s faster than C by optimizing your code, adding standard type annotations, and using Mypyc.

You Should Compile Your Python And Here’s Why

write Python that’s faster than C by optimizing your code, adding standard type annotations, and using Mypyc.