@whitequark@mastodon.social @mei@donotsta.re Yes. I meant in my original comment that, in Python and other introspected languages, my expectation is to be thankful if the interpreter can do any optimizations at all. When the runtime is subject to inspections and changes, nothing is trivial.
Conversation
Notices
-
Embed this notice
niconiconi (niconiconi@mk.absturztau.be)'s status on Wednesday, 21-Aug-2024 21:53:26 JST niconiconi - Haelwenn /элвэн/ :triskell: likes this.
-
Embed this notice
✧✦✶✷Catherine✷✶✦✧ (whitequark@mastodon.social)'s status on Wednesday, 21-Aug-2024 21:53:27 JST ✧✦✶✷Catherine✷✶✦✧ @niconiconi @mei PyPy optimizes this just fine by the way. we recommend it for running Amaranth code that has hot simulation loops, the speedups are significant
-
Embed this notice
✧✦✶✷Catherine✷✶✦✧ (whitequark@mastodon.social)'s status on Wednesday, 21-Aug-2024 21:53:27 JST ✧✦✶✷Catherine✷✶✦✧ @niconiconi @mei the way it works is that it keeps the CPython style bytecode compiler (for introspection reasons) but it doesn't run bytecode (which a program can't modify anyway), it runs native code and whenever you take a stack trace the unwinder looks up what the Python stack was at that point
it's not radically different from other JITs even
-
Embed this notice
✧✦✶✷Catherine✷✶✦✧ (whitequark@mastodon.social)'s status on Wednesday, 21-Aug-2024 21:53:27 JST ✧✦✶✷Catherine✷✶✦✧ @niconiconi @mei (I'm oversimplifying for the sake of fitting this in a mastodon post)
-
Embed this notice
✧✦✶✷Catherine✷✶✦✧ (whitequark@mastodon.social)'s status on Wednesday, 21-Aug-2024 21:53:27 JST ✧✦✶✷Catherine✷✶✦✧ @niconiconi @mei things like being able to redefine methods at runtime are actually a lot worse to handle, you need inline method lookup caches and epochs and invalidation... (or at least that is one way to do it)
-
Embed this notice
niconiconi (niconiconi@mk.absturztau.be)'s status on Wednesday, 21-Aug-2024 21:53:28 JST niconiconi @mei@donotsta.re The next time people claim Python is horribly inefficient due to developer's incompetence, just show them this example. Ask them what are their solutions for optimizing any code at all if Python allows such an extreme level of runtime introspection.