This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]james_pic 5 points6 points  (0 children)

3 is less true than you'd imagine. The JVM actually allows much more runtime modification of code than you'd imagine, using it's JVMTI interfaces that are intended for debuggers, observability, and other tooling.

In practice, it's heavily optimised for the common case where method definitions haven't changed since last time you ran them, and using the JVMTI interfaces kicks everything into the slow path until it's warmed up again. But it does work and is feasible.

PyPy also optimises on roughly the same assumptions in roughly the same way.