Compiler Alternative: The Interpreter
Another core tool for running source codeis called an interpreter.
An interpreter executes source code directly line-by-line, without compiling it into machine code.
Because of the line-by-line interpretation, an interpreted program typically runs slower than compiled code.
Also, an interpreted program doesn’t generate a machine code file like comp.
Disadvantages of A Compiler
Something to keep in mind here is that compilation makes the code platform-dependent.
This means that compiled code produces a machine-readable and machine-specific executable file that only the particular type of machine is able to execute.
This means that code compiled on a Windows machine won’t run on a Mac or Linuxsystem without being recompile.
How Does A Compiler Work?
A compiler analyzes the source code and breaks it down into individual instructions that the computer can understand.
In other words, a compiler turns human-readable program code into zeroes and ones.
What does a compiler do?
A compiler analyzes the source code and breaks it down into individual instructions that the computer can understand.
In other words, a compiler turns human-readable program code into zeroes and ones. 1.
Lexical Analysis .
Why Do We Use compilers?
Programmers use compilers to translate high-level programming languages into machine code that computers can understand and execute.
Compilers play a critical role in the development process because they help catch syntax and semantic errors before we run the code, which saves time and prevents crashes.
Compilers also optimize the code for efficien.