कम्पाइलर किसे कहते है
Views
TYPE
What is compiler
For some time, forget about compiler and imagine that you have gone to a beautiful country to spend your vacation. A very basic problem in this is that you speak, write and understand only in your regional language which is Hindi. But there the citizens of that country do not know anything other than English only. Then how will you communicate with others there?
In such a situation, the only solution is that you will need a language translator, which can be a human or a book or even an App. This language translator will translate your Hindi into English so that the other person can understand your words. Together, he will convert English into Hindi as well so that you too can understand his language.
The same thing happens with a computer. Computers also understand only binary language (language which consists of 0s and 1s), while users who understand Computer as English or any language. In such a situation, how will the computer understand the commands given by you? Also, you will not understand any process calculation performed by the computer. In such a situation, there is a need for a language translator so that they can ma
What is Compiler
What is Compiler
If not, then there is a great opportunity for you to understand this technology easily. Whether you are from a technical student or a non-tech background, it is good for everyone to understand this compiler. Because it is used in all places. By the way, it is very important for a Computer Science student to understand it. Because if you have to understand about programming completely then it becomes very important to know about the work of the compiler.
What is compiler
For some time, forget about compiler and imagine that you have gone to a beautiful country to spend your vacation. A very basic problem in this is that you speak, write and understand only in your regional language which is Hindi. But there the citizens of that country do not know anything other than English only. Then how will you communicate with others there?TYPE
One classification of compilers is by the platform on which their generated code executes. This is known as the target platform.
A native or hosted compiler is one whose output is intended to directly run on the same type of computer and operating system that the compiler itself runs on. The output of a cross compiler is designed to run on a different platform. Cross compilers are often used when developing software for embedded systems that are not intended to support a software development environment.
The output of a compiler that produces code for a virtual machine (VM) may or may not be executed on the same platform as the compiler that produced it. For this reason such compilers are not usually classified as native or cross compilers.
The lower level language that is the target of a compiler may itself be a high-level programming language. C, viewed by some as a sort of portable assembly language, is frequently the target language of such compilers. For example, Cfront, the original compiler for C++, used C as its target language. The C code generated by such a compiler is usually not intended to be readable and maintained by humans, so indent style and creating pretty C intermediate code are ignored. Some of the features of C that make it a good target language include the
#line
directive, which can be generated by the compiler to support debugging of the original source, and the wide platform support available with C compilers.
While a common compiler type outputs machine code, there are many other types:
- Source-to-source compilers are a type of compiler that takes a high-level language as its input and outputs a high-level language. For example, an automatic parallelizing compiler will frequently take in a high-level language program as an input and then transform the code and annotate it with parallel code annotations (e.g. OpenMP) or language constructs (e.g. Fortran's
DOALL
statements). - Bytecode compilers that compile to assembly language of a theoretical machine, like some Prolog implementations
- This Prolog machine is also known as the Warren Abstract Machine (or WAM).
- Bytecode compilers for Java, Python are also examples of this category.
- Just-in-time compilers (JIT compiler) defer compilation until runtime. JIT compilers exist for many modern languages including Python, JavaScript, Smalltalk, Java, Microsoft .NET's Common Intermediate Language (CIL) and others. A JIT compiler generally runs inside an interpreter. When the interpreter detects that a code path is "hot", meaning it is executed frequently, the JIT compiler will be invoked and compile the "hot" code for increased performance.
- For some languages, such as Java, applications are first compiled using a bytecode compiler and delivered in a machine-independent intermediate representation. A bytecode interpreter executes the bytecode, but the JIT compiler will translate the bytecode to machine code when increased performance is necessary.[47][non-primary source needed]
- Hardware compilers (also known as syntheses tools) are compilers whose output is a description of the hardware configuration instead of a sequence of instructions.
- The output of these compilers target computer hardware at a very low level, for example a field-programmable gate array (FPGA) or structured application-specific integrated circuit (ASIC).[48][non-primary source needed] Such compilers are said to be hardware compilers, because the source code they compile effectively controls the final configuration of the hardware and how it operates. The output of the compilation is only an interconnection of transistors or lookup tables.
- An example of hardware compiler is XST, the Xilinx Synthesis Tool used for configuring FPGAs.[49][non-primary source needed] Similar tools are available from Altera,[50][non-primary source needed] Synplicity, Synopsys and other hardware vendors.[citation needed]
- An assembler is a program that compiles human readable assembly language to machine code, the actual instructions executed by hardware. The inverse program that translates machine code to assembly language is called a disassembler.
- A program that translates from a low-level language to a higher level one is a decompiler.[citation needed]
- A program that translates between high-level languages is usually called a language translator, source-to-source compiler, language converter, or language rewriter.[citation needed] The last term is usually applied to translations that do not involve a change of language.[51]
- A program that translates into an object code format that is not supported on the compilation machine is called a cross compiler and is commonly used to prepare code for embedded applications.[citation needed][clarification needed]
- A program that rewrites object code back into the same type of object code while applying optimisations and transformations is a binary recompiler.