Do Compilers Generate Code?

In computing, code generation is the process by which a compiler's code generator converts some intermediate representation

intermediate representation
An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code. An IR is designed to be conducive for further processing, such as optimization and translation. ... A canonical example is found in most modern compilers.
› wiki › Intermediate_representation
of source code into a form (e.g., machine code) that can be readily executed by a machine. Sophisticated compilers typically perform multiple passes over various intermediate forms.

Does compiler generate machine code?

A Basic Distinction. Many compilers do not directly generate machine code. Instead, the semantic action routines driven by the parser operate in terms of a high-level virtual machine provided by the interface to the code generator. ... A family of compilers for different languages can rest on the same code generator.

How compilers are coded?

The compiler is taking your human-readable source code, analyzing it, then producing a computer-readable code called machine code (binary). Some compilers will (instead of going straight to machine code) go to assembly, or a different human-readable language. Human-readable languages are AKA high-level languages.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.