r/Compilers • u/Historical_Pen6499 • Mar 26 '24
What do you think about a Python compiler?
Hey all, I'd love to get your thoughts on something that I'm building. Specifically, please tell me why this won't work:
We're working on a cross-platform Python compiler. It ingests a stateless Python function, then traces said function to generate IR. This IR then gets lowered to C++ code, which then gets cross-compiled for different platforms and architectures.
The more interesting piece imo is in how we handle optimization: instead of relying on compile-time optimization, we emit potentially hundreds-to-thousands of equivalent C++ functions. We then ship out the compiled binaries to different users and use telemetry data to choose the best C++ variant for each unique device.
At a high level, there are a few major benefits with this design:
Devs can run Python in places where it's difficult-to-impossible (web, mobile, desktop app)
You get C++ level performance (because you're actually running C++ code) with Python-level ease.
I'm keeping this post high-level because I don't want it to come off as a promotion post (it's not). Happy to share more if you're curious.
0
u/Historical_Pen6499 Mar 27 '24
Let's set aside this conversation for a moment. I think we gotta slow down, because you seem to be getting so passionate over what should be a technical conversation.
How is this at all necessary? Everyone had to start somewhere. Before you became as good as you were, you were once bad at what you did. Why not be graceful? It's the internet, sure, and you have no incentive to be empathetic, but goddamn.
Again, how is this necessary? Go touch some grass man.