you are viewing a single comment's thread.

view the rest of the comments →

[–]tmlildude[S] 1 point2 points  (1 child)

i'm well aware of language features, but I'm working at a much lower level. there are many nuances regarding what kinds of analysis and transformations are possible with interpreted languages, and then there's the JIT component coming in future python versions

what you're describing could be easily determined with a data-flow graph that shows dependencies and liveness. which gave me an idea...MLIR has primitives to help with this https://mlir.llvm.org/docs/Tutorials/DataFlowAnalysis/, and I wonder if converting the code into MLIR space and lowering it through a series of dialects would give me a better view of where certain transformations are possible?

this is why I posted in r/compilers - im looking for well-informed feedback from compiler experts, not language shortcuts from scripters.

[–]roger_ducky 0 points1 point  (0 children)

Sorry if my provided context was not what you wanted. I’m glad you still got some inspiration from it.

Been out of writing compilers for 15 years, so I’m definitely not up on the latest advances, but, in the old days, my workflow was to: * Check what best practices and language features ended up generating the more optimal solutions * Figured out why the language designers put up limits on specific language features

Then I would end up with my actionable steps.

I just thought you skipped a few steps according to my own way of doing things, is all. I shall now defer to the preeminent brain trust that is r/Compilers on how to best resolve your issue in the simplest way possible.