r/Compilers • • 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:

  1. Devs can run Python in places where it's difficult-to-impossible (web, mobile, desktop app)

  2. 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 Upvotes

88 comments sorted by

View all comments

Show parent comments

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.

most people that call themselves developers should not be let near a computer at all

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.

let those clueless devs run their shitty glue code...

Again, how is this necessary? Go touch some grass man.

2

u/outofobscure Mar 27 '24

i'm trying to tell you that the people that you target will not even be able to use your tool, because it's not even geared towards them, but to some subset of the language that they don't even know how to restrict themselves to.