FACTOID # 51: Russia won the first World Air Games, held in Turkey in 1997. Events included hang-gliding, sky-surfing, and ballooning.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Code generation

In computer science, code generation is the process by which a compiler's code generator converts a syntactically-correct program into a series of instructions that could be executed by a machine. Sophisticated compilers may use several cascaded code generation stages to fully compile code; this is due to the fact that algorithms for code optimization are more readily applicable in an intermediate code form, and also facilitates a single compiler that can target multiple architectures as only the final code generation stage (the backend) would need to change from target to target. Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. ... A diagram of the operation of a typical multi-language compiler. ... In computing, optimization is the process of modifying a system to improve its efficiency. ...


The input to the code generator stage typically consists of a parse tree, abstract syntax tree, or intermediate language code (often in three address code form). Since the target machine may be a physical machine such as a microprocessor, or an abstract machine such as a virtual machine or an intermediate language, (human-readable code), the output of code generator could be machine code, assembly code, code for an abstract machine (like JVM), or anything between. A parse tree is a tree that represents the syntactic structure of a string according to some formal grammar. ... In computer science, an abstract syntax tree (AST) is a finite, labeled, directed tree, where the internal nodes are labeled by operators, and the leaf nodes represent the operands of the node operators. ... In computer science, an intermediate language is the language of an abstract machine designed to aid in the analysis of computer programs. ... In computer science, three address code is a form of representing intermediate code used by compilers to aid in the implementation of code-improving transformations. ... Microprocessors, including an Intel 80486DX2 and an Intel 80386. ... An abstract machine, also called an abstract computer, is a theoretical model of a computer hardware or software system. ... In general terms, a virtual machine in computer science is software that creates a virtualized environment between the computer platform and the end user in which the end user can operate software. ... For the term Human code applied to genetics, see Human genome. ... A Java virtual machine or JVM is a virtual machine that runs Java byte code. ...


In a more general sense, code generation is used to produce programs in some automatic manner, reducing the need for human programmers to write code manually. Code generations can be done either at runtime, including load time, or compiler time. Just-in-time compilers are an example of a code generator that produce native or nearly native code from byte-code or the like when programs are loaded onto the compilers. On the other hand, a compiler-compiler, (yacc, for example) almost always generates code at compiler time. A preprocessor is an example of the simplest code generator, which produces target code from the source code by replacing predefined keywords. In computer science, run time (with a space, though often its spelled without one) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... In computing, a loader is a program that performs the functions of a linker program and then immediately schedules the resulting executable program for action (in the form of a memory image), without necessarily saving the program as an executable file. ... In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ... See also Just in time for the business technique In computing, just-in-time compilation (JIT), also known as dynamic translation, is a technique for improving the performance of interpreted programs. ... Yacc is a piece of computer software that serves as the standard parser generator on Unix systems. ... In computer science, a preprocessor is a program that takes source code and performs transformations on it, before the step of compilation or interpretation. ...


When code generation occurs at runtime, it is important that it is efficient in space and time. For example, when regular expressions are interpreted and used to generate code at runtime, a non-determistic FSA instead of deterministic one is often generated because usually the former can be created more quickly and occupies less memory space than the latter. Despite it generally generating less efficient code, code generation at runtime can take the advantage of being done at runtime. Some people cite this fact to note that a JIT compiler can generate more efficient code than a compiler invoked before runtime, since it is more knowledgeable about the context and the execution path of the program than when the compiler generates code at compile time. In computer science, run time (with a space, though often its spelled without one) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ... Fig. ... In computer science, run time (with a space, though often its spelled without one) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ...


Major tasks in code generation

In addition to basic conversion from intermediate representation into machine instructions, code generator also tries to use faster instructions, use fewer instructions, exploit available fast registers and avoid redundant computations.

  • Instruction selection. With the diverse instructions supported in a target machine, instruction selection deal with the problem of which instructions to use
  • Instruction scheduling. In what order to run the instructions.
  • Register allocation. The speed gap between processors and memory is partially bridged by the registers in processors. How to put useful variables into registers has a great impact of the final performance.

The usual method is a state machine, or weak artificial intelligence scheme that selects and combines templates for computations. Instruction selection is a compiler optimization that transforms an intermediate representation of a program into the final compiled code, either in binary or assembly format. ... In computer science, instruction scheduling is a compiler optimization used to improve instruction-level parallelism, which improves performance on machines with instruction pipelines. ... In compiler optimization, register allocation is the process of multiplexing a large number of target program variables onto a small number of CPU registers. ... Hondas intelligent humanoid robot AI redirects here. ...


See also

In computer science, three address code is a form of representing intermediate code used by compilers to aid in the implementation of code-improving transformations. ... The Model-Driven Architecture (MDA) is a software design approach, proposed and sponsored by the Object Management Group. ... // Presentation MDE (Model Driven Engineering) is an emerging technique in software, system and data engineering, based on the systematic use of models. ... Rapid application development (RAD), is a software development process developed initially by James Martin in the 1980s. ... ERWin CASE tool on Windows 2000 Computer-aided software engineering (CASE) is the use of software tools to assist in the development and maintenance of software. ... The server-side web template in the web page process, to produce dynamic web pages with the template engine. ... ...

External links


  Results from FactBites:
 
Code generation - Wikipedia, the free encyclopedia (496 words)
In computer science, code generation is the process by which a compiler's code generator converts a syntactically-correct program into a series of instructions that could be executed by a machine.
The input to the code generator stage typically consists of a parse tree, abstract syntax tree, or intermediate language code (often in three address code form).
Just-in-time compilers are an example of a code generator that produce native or nearly native code from byte-code or the like when programs are loaded onto the compilers.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.