Share

What is a compiler? How source code becomes machine code

A compiler is a computer program that translates from one format to another, most often from a high-level computer language to byte code and machine code. Compilers come in a number of variations, which we will explore in this article.

Compilers, transpilers, interpreters, and JIT compilers

Compilers often translate source code for a high-level language, such as C++, to object code for the current computer architecture, such as Intel x64. The object modules produced from multiple high-level language files are then linked into an executable file.

Compilers intended to produce object code for architectures that differ from the one running the compiler are called cross-compilers. It is common to use cross-compilers running on desktop (or larger) computers to produce executables for embedded systems. Compilers that translate from one high-level language to another, such as from TypeScript to JavaScript or from C++ to C, are called transpilers. Compilers written in the language that they are compiling are called bootstrap compilers.

To read this article in full, please click here

Author: . [Source Link (*), InfoWorld]

Shop with us!