A compiler is responsible for translating a source code, which is written in a programming language, into a target language. This is most commonly done in order to create an executable program. A compiler is mainly used for programs that translate a source code into an assembly language or machine code, which are both a lower level language than the source code.
There are different types of compilers, for example, a cross-compiler is one that will run a compiled program on a computer whose operating system or CPU is different from the one on which the compiler runs; and a decompiler translates from a low level language to a higher one.
An interpreter is a program that carries out the instructions that are written in a programming language. It can do this in a number of ways: It can directly perform the source code; it can decipher the source code into an efficient code (also known as intermediate representation) and implement this straight away; or it specifically carries out a precompiled code that has been made and stored by a compiler.
Compiling and interpreting are the two primary ways that programming languages are realised.
Assemblers create an object code by translating assembly instruction mnemonics into opcodes. They also determine symbolic names for memory locations as well as for other entities. A prime characteristic of assemblers is the use of symbolic references, which saves time consuming manual calculations and address updates after a program has been modified. The majority of assemblers also have macro facilities so that they can perform textual substitution, which means that they are able to create short sequences of instructions.
It is easier to write an assembler for high level languages than it is to write a compiler, and in fact, they have been around since the 1950s.
There are different types of compilers, for example, a cross-compiler is one that will run a compiled program on a computer whose operating system or CPU is different from the one on which the compiler runs; and a decompiler translates from a low level language to a higher one.
An interpreter is a program that carries out the instructions that are written in a programming language. It can do this in a number of ways: It can directly perform the source code; it can decipher the source code into an efficient code (also known as intermediate representation) and implement this straight away; or it specifically carries out a precompiled code that has been made and stored by a compiler.
Compiling and interpreting are the two primary ways that programming languages are realised.
Assemblers create an object code by translating assembly instruction mnemonics into opcodes. They also determine symbolic names for memory locations as well as for other entities. A prime characteristic of assemblers is the use of symbolic references, which saves time consuming manual calculations and address updates after a program has been modified. The majority of assemblers also have macro facilities so that they can perform textual substitution, which means that they are able to create short sequences of instructions.
It is easier to write an assembler for high level languages than it is to write a compiler, and in fact, they have been around since the 1950s.