A language processing system is one which bridges the gap of communication between machines and humans, using a variety of tools and several steps to convert one language into another. For instance, a computer understands binary language, which is not feasible for programmers to manually code. Programs are usually written in some high level languages. This high-level language is converted into binary language in several steps or phases.
A compiler is
a type of language processor that converts another program in high-level language into assembly language.
A preprocessor is a tool that takes input, modifies it and then produces output which actually is input for another program such as compilers. It deals with macro-processing, augmentation, file inclusion, language extension,
etc. The primarily role of a preprocessor is text substitution. For example, in C or C++, we include header files - these header files are substituted with their content (methods and variables - the entire header file content) before actual compilation takes place.
An interpreter, is a type of language processor that translates high-level language into low-level machine
language line-by-line. It differs from a compiler in that a compiler reads the whole program at once, and then displays all errors in the program, while interpreter
reads a statement and stops execution on encountering an error. Difference between compiler and interpreter are depicted with the following infographic:
|
Compiler vs Interpreter |
An assembler is a type of language processor that takes assembly language programs as input and translates them into their equivalent machine codes.
Linker is a program that links several files of relocatable machine code together to
make an executable file. These files are usually libraries and modules required for the program.
Loader is a program in the operating system responsible for loading executable files into
memory and executing them. All the relocatable addresses are altered, and the program and data is loaded into memory.
A compiler capable of generating executable code for one platform while running on another is called a cross-compiler.
A compiler that converts the source code of a program from one programming language to another is called a source-to-source compiler, or a transcompiler or transpiler.