Compiled vs Interpreted
Let's compare two popular languages and see how they are executed. On one side we have C#, which is a popular compiled language, and on the other side we have python which is a popular interpreted language.
TL;DR
C# code is a compiled into IL code and then into machine code. This machine code is then executed.
Python code, like many interpreted languages, is compiled to bytecode. These bytecode instructions are then executed.
C# process
Image source: Geeks for geeks
Python process
Image source: Pro Code Guide
Compiled C# advantages
C# by default performs type checking at the compile time and as a result, type errors are pinpointed as early as possible.
Compiled code tends to run faster than interpreted code because it has been translated into machine code that can be directly executed by the computer’s processor.
Just-in-time (JIT) compilation from IL enables versatility of C# applications that can be run everywhere, from Windows to PlayStation.
Interpreted Python advantages
As an interpreted language, Python facilitates rapid development and testing, as code can be executed as soon as it is written without requiring a separate compilation step. This feature significantly speeds up the development process and makes Python an excellent choice for prototyping and iterative development.
Python’s interpreted nature makes it more flexible and dynamic, allowing for easier debugging and immediate feedback during the coding process. It also contributes to Python’s cross-platform compatibility, as the same Python code can run on multiple operating systems without modification, making it highly versatile for various applications.
As usual, I hope this was helpful!
References
Subscribe to my newsletter
Read articles from Rohan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Rohan
Rohan
Software engineer and blogger