fnands.com

Translating Cython to Mojo, a first attempt

fnands · 87 points · 33 comments · 6 окт. · Open original

Comments

5 preview comments · loading full thread
hyperbovine7 окт.

In my niche corner of scientific computing it feels like Cython has largely been replaced by Numba and CFFI, or just Julia. Last I checked it still needed setup.py which is a bit of a deal breaker in 2025.

adsharma6 окт.

A more interesting path is to keep dbscan_inner in pure python with type annotations and then use py2many --mojo=1 dbscan_inner.py to translate.

RossBencina7 окт.

Very interesting. I'm currently trading off whether to use Mojo or C++/pybind to accelerate simulations that combine matrix operations with fine-grained scalar calculations. I only recently learned that pybind + cppimport offers the integrated compile-on-import experience available in Mojo.

pjmlp7 окт.

> I think moving a lot of scikit-learn’s more computationally intensive code to Mojo could be an interesting project. Only if you want to lose access to Windows users, as it is a low priority for Mojo development.

jononor8 окт.

Mojo is not open source, so how can it be realistic to use it in scikit-learn? We spent decades getting out of the clutches of Mathworks, Microsoft, etc. Why are people eager to go back that way?