r/Python • • 27d ago

Discussion Feasibility check: Writing a constrained Python-to-Rust transpiler for numeric code

so i would want to know about the feasibility of such a tool/project and whether it has any real uses or is it the equivalent of re inventing a worse wheel , basically core idea is to somehow transpile python to rust but not all of python ,instead more similar to numpy but instead the whole specified block of code is compiled for maximum speed almost like numba?? any feedback would be appreciated

14 Upvotes

22 comments sorted by

View all comments

1

u/teerre 27d ago

I mean, there are python to GPU kernel compilers, so obviously to Rust is also possible. Now, how useful it is it's a different question. "Numerical code" is already executed in a low level language if you use anything remotely standard, so benefits are dubious

And of course, this is without considering the elephant in the run which is just because you can write a transpiler, it doesn't mean it will be a good one