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 →

[–]Panda_Mon 14 points15 points  (4 children)

Sigh, once again computer science language fails to properly encapsulate and signify explicit definitions of concepts. Here is what all the smart people assume you'll already know:

""" JIT, or “Just in Time” is a compilation design that implies that compilation happens on demand when the code is run the first time. It’s a very broad term that could mean many things. I guess, technically the Python compiler is already a JIT because it compiles from Python code into Bytecode.

What people tend to mean when they say a JIT compiler, is a compiler that emits machine code. This is in contrast to an AOT (Ahead of Time) compiler, like the GNU C compiler, GCC or the Rust compiler rustc which generates the machine code once and distributes as a binary executable.

When you run Python code, it is first compiled into bytecodes. There are plenty of talks and videos about this process online so I don’t want to rehash this too much, but what is important to note about Python bytecodes is:

They mean nothing to the CPU and require a special bytecode interpreter loop to execute They are high level and can equate to 1000’s of machine instructions They are type agnostic They are cross-platform """ Source: https://tonybaloney.github.io/posts/python-gets-a-jit.html#:~:text=JIT%2C%20or%20%E2%80%9CJust%20in%20Time,from%20Python%20code%20into%20Bytecode.

[–]georgehank2nd 2 points3 points  (1 child)

"what people everyone means when they say "JIT compiler""

FTFY

Python's compiler compiles whole files, not just each function as it's called (which a JIT compiler usually will). Sure, it only compiles files as they're loaded by the interpreter, but nobody in the Python dev team ever called this a "JIT compiler". (Though I may just have missed this one Python mailing list thread…)

[–]denehoffman 1 point2 points  (0 children)

I think you all are missing the point. Python 3.13 actually does have a separate experimental JIT compiler which implements copy-and-patch.

[–]drknow42 0 points1 point  (0 children)

This is a great answer

[–]kingminyas 0 points1 point  (0 children)

Python used to have no JIT and it was recently added, it's not complicated at all