• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » What is a Compiler?

By Abhishek Ghosh May 31, 2023 5:53 am Updated on May 31, 2023

What is a Compiler?

Advertisement

A compiler is a computer program that translates source codes of a particular programming language into a form that can be executed directly by a computer (microprocessor or microcontroller). The process of translation is also known as compilation or transformation. The opposite, i.e. the retranslation of machine language into the source code of a particular programming language, is called decompilation and corresponding programs are called decompilers.

A compiler performs the following operations: lexical analysis, pre-processing, parsing, semantic analysis, and optimized code generation. The compilation is often followed by a link editing step, to generate an executable file. When the compiled program (object code) is run on a computer whose processor or operating system is different from that of the compiler, it is called cross-compilation.

In the analysis phase, the code is analyzed, structured and checked for errors. Languages such as modern C++ do not allow syntax analysis to be divided into lexical analysis, syntactic analysis, and semantic analysis due to ambiguities in their grammar. Their compilers are correspondingly complex.

Advertisement

---

  • Syntax checking: It is checked whether the source code is a valid program, i.e. whether it corresponds to the syntax of the source language. Any errors detected are logged. The result is an intermediate representation of the source code.
  • Analysis and optimization: The intermediate representation is analyzed and optimized. This step varies greatly in scope depending on the compiler and user preference. It ranges from simpler efficiency optimizations to program analysis.
  • Code generation: The optimized intermediate display is translated into corresponding commands of the target language. Further, target language-specific optimizations can be made. Modern compilers (mostly) no longer perform code generation themselves.

In the frontend, the code is analyzed, structured and checked for errors. It itself, in turn, is divided into phases. Modern languages such as C++ do not allow syntax analysis to be divided into lexical analysis, syntactic analysis, and semantic analysis due to ambiguities in their grammar. Their compilers are correspondingly complex.

The synthesis phase generates the program code of the target language from the attributed syntax tree created by the frontend. Many modern compilers generate an intermediate code from the syntax tree, which can already be relatively close to the machine, and carry out program optimizations on this intermediate code, for example. This is especially useful for compilers that support multiple source languages or different target platforms. Here, the intermediate code can also be an exchange format.

What is a Compiler

The intermediate code is the basis of many program optimizations. During code generation, the program code of the target language is generated either directly from the syntax tree or from the intermediate code. If the target language is a machine language, the result can be directly an executable program or a so-called object file, which leads to a library or an executable program by linking to the runtime library and possibly other object files. This is all done by the code generator, which is part of the compiler system, sometimes as a program part of the compiler, sometimes as a standalone module.

Some compilers translate a source language into a virtual machine language (called intermediate language), that is to say into a code (usually binary) executed by a virtual machine: a program emulating the main features of a computer. Such languages are called semi-compiled. Porting a program only requires porting the virtual machine, which will be either an interpreter or a second translator (for multi-target compilers). Thus, compilers translate Pascal into P-Code or more recently Java code into Java bytecode (object code).

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to What is a Compiler?

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Change Github’s Default Gist Style With jQuery Plugins

    Yes, There Are jQuery Plugins to Change Github’s Default Gist Style With jQuery Plugins! They can do lot of works than simple changing look.

  • What is JIT (Just-in-time) Compilation?

    JIT or Just-in-time Compilation is a technique to improve the performance of software that compile to byte code, translating the byte code to machine code at runtime.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is a Digital-to-Analog Converter (DAC)September 25, 2023
  • Tips on S Pen Air ActionsSeptember 24, 2023
  • Market Segmentation in BriefSeptember 20, 2023
  • What is Booting?September 18, 2023
  • What is ncurses?September 16, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy