In the realm of programming, our high-level code (C, python, C++) needs to be translated before a machine can comprehend and run it.
Decades ago, pioneers in the computing field, wrote programs in machine language, which is essentially binary numbers.
As technology advanced, higher-level languages developed, allowing programmers to write code more intuitively without needing to understand the nitty-gritty details of a machine.
But, the machine still understands only binary. So, how do we bridge this gap? With compilers and interpreters.
Compilers vs. Interpreters
Compiler: Transforms the entirety of a high-level code into machine code all at once. Resultant is an executable file, specific to an architecture or operating system.
Interpreter: Translates high-level code line-by-line and executes it simultaneously. Python and Java for example have an interpreter.
Example: Imagine speaking with a foreigner with a live translator whispering translations in your ear.