r/AskComputerScience • u/dgpking • Apr 25 '21
Does all programming turn into machine code?
I don’t know if this question makes sense but when you write code in whatever language, python, C, Java etc does it all eventually get converted into assembly and then machine code?
35
Upvotes
2
u/Objective_Mine MSCS, CS Pro (10+) Apr 25 '21
Mainly performance.
At the simplest level, interpretation means that you have the CPU running a program A (the interpreter) that's executing another program B (the interpreted program), rather than having the code of program B executed directly on the CPU.
At runtime, interpreted program execution tend to be 2 to 100 times slower than just running a program that's been compiled into native machine code, depending on the language and the interpreter, and on which kind of code the interpreted program happens to consist of.