Keep in mind that my knowledge base is two decades old. That said....
High level languages are generic, compilers (and interpreters) produce machine readable code.
builtin.com/software-engineering-perspectives/compiler
Quote:
Compilers are an essential part of software development. Compilers allow developers to write programs in high-level languages that humans can understand, but then convert that high-level language into a form that only a machine can read.
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.- Lexical Analysis -- ]First, the compiler performs a lexical analysis in which it breaks the source code down into a sequence of tokens that represent the individual elements of the program like keywords, operators and identifiers.
- Syntactic and Semantic Analysis -- Next, the compiler performs a syntactic analysis. In this phase, it checks the source code for any syntax errors and ensures that it follows the correct language-specific rules and conventions. If any errors occur, the compiler throws an error and stops the compilation.
- Optimization -- Once the compiler has successfully parsed and checked the source code for errors, it runs low-level optimization on the code to improve its performance. This can involve reducing the amount of memory the program uses or optimizing the code for speed by rearranging instructions or eliminating unnecessary operations.
- Output Code Generation -- Finally, the compiler generates the machine code that corresponds to the original source code. This machine code lives in a binary file that the computer’s hardware can execute directly.
|