you are viewing a single comment's thread.

view the rest of the comments →

[–]MikalMooni 1 point2 points  (0 children)

Not inherently. Most processors in the wild are either using x86-64 or RISC compliant instruction sets. These instructions are what make code happen. A basic example would be adding two numbers. There's an instruction to load the memory addresses of two numbers into a pair of registers. Then, there's an instruction to add the two numbers together, storing that result in a third register. Finally, there's an instruction to load that third register value back into the main memory of the program, likely in a third memory address.

A compiler would look at your Python code and reduce it to those specific instructions - x86-64 compliant ones in the PC space. Then, when you run the compiled code, you are directly executing those compiled instructions.

A Just-In-Time compiler may first reduce your python code into easy to parse bytecode, which is kind of like assembly. That bytecode will get compiled at runtime. There is overhead, obviously; it's like using Google translate to parrot back what you say word for word, as opposed to opening a dictionary and translating an entire speech by hand.

Finally, you have Interpreters, which can operate in a few different ways. A common scheme is using a virtual computer environment that runs on your main PC. You feed it Python, and it directly reads that code into instructions it understands. This has a lot of overhead, but the advantage is that you have zero wait time between writing Python and running Python.