The term programming language usually refers to set of grammatical rules for instructing a computer to perform specific tasks. Each language has a unique set of keywords (words that it understands) and a special syntax for organizing program instructions.
High-level programming languages are simple compared to human languages which are more complex than the languages the computer actually understands called machine languages. Different types of CPU has its own unique machine language.
Lying between machine languages and high-level languages are languages called assembly languages. Assembly languages are similar to machine languages, but they are much easier to program because they allow a programmer to substitute names for numbers. Machine languages consist of numbers only.
Regardless of what language you use, you eventually need to convert your program into machine language so that the computer can understand it. There are two ways to do this:
1) Compile the program
To transform a program written in a high-level programming language from source code into object code. Programmers write programs in a form called source code. Source code must go through several steps before it becomes an executable program. The first step is to pass the source code through a compiler, which translates the high-level language instructions into object code.
The final step in producing an executable program -- after the compiler has produced object code -- is to pass the object code through a linker. The linker combines modules and gives real values to all symbolic addresses, thereby producing machine code.
2) Interpret the program
An interpreter translates high-level instructions into an intermediate form, which it then executes. In contrast, a compiler translates high-level instructions directly into machine language. Compiled programs generally run faster than interpreted programs. The advantage of an interpreter, however, is that it does not need to go through the compilation stage during which machine instructions are generated. This process can be time-consuming if the program is long. Both interpreters and compilers are available for most high-level languages.


No comments:
Post a Comment