[WEBINAR] Application Acceleration: Faster Performance for End Users

Code Generation

Definition - What does Code Generation mean?

Code generation is a mechanism where a compiler takes the source code as an input and converts it into machine code. This machine code is actually executed by the system. Code generation is generally considered the last phase of compilation, although there are multiple intermediate steps performed before the final executable is produced. These intermediate steps are used to perform optimization and other relevant processes.

Techopedia explains Code Generation

The code generation process is performed by a component known as a code generator, part of the compiler program. The original source code of any program passes through multiple phases before the final executable is generated. This final executable code is actually the machine code, which computer systems can execute readily.

In the intermediate phases of compilation, code optimization rules are applied one at a time. Sometimes these optimization processes are dependent on each other, so they are applied one after another based on the dependency hierarchy. After passing multiple phases, a parse tree or an abstract syntax tree is generated and that is the input to the code generator. At this point, the code generator converts it into linear sequential instructions. After this stage, there may be some more steps depending upon the compiler. The final optimized code is the machine code for execution and output generation.

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
"Techopedia" on Twitter

Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.