You are on page 1of 3

COMPUTER LANGUAGES

WHAT ARE COMPUTER LANGUAGES? A computer language means, a set of rules and symbols used to operate a computer. Whatever command we give to computer, it is first converted in its own language. A computer language is also known as Programming Language. There are various types of programming languages. These languages are used to write programs to tell the computer what to do. Users who write these programs are called programmers. Each computer language has its own set of rules and grammar. These are called the syntax rules of the language. This syntax rules should be followed while writing a program. Computer Languages have progressed over the years just like hardware. Starting from the language made up to just two symbols 0 and 1, today, you can make the computer programs using common English and Mathematical terms. On the whole these languages are classified under three categories: Machine Language or Low level language Assembly Language High Level Language

Machine Level Language : You know that a computer can understand only special signals, which are represented by 1s and Os. These two digits are called binary digits. Computer understands program written in binary digits. The language, which uses binary digits, is called the machine level language. Machine language has its own advantages and disadvantages. 1. Machine Dependent: As the internal design of the computer differ from one computer to another, their machine codes are also different. So, the program designed for one type of machine cannot be used for another type of machine. 2. Fast processing: As the machine code instructions are directly understood by the computer and do not require any translator, the program written in the machine language are very fast and processed very quickly. 3. Error prone: As the programmer has to write all the instructions using 0's and 1's it is a very cumbersome job, the chances of error prone codes are more in writing a machine level language program. 4. Difficult to use: As machine language uses only 0 and 1 two symbols to represent all data and instructions it is very difficult to remember the machine codes for the different commands.

Assembly Language: These languages use letters and symbols instead of binary digits. These symbols are called Mnemonics. Programs written in assembly level languages are called assembly codes. Assembly codes are translated into machine level language instructions. Assembly level language is easier to understand than machine level language. Advantages and disadvantages of Assembly language are: 1. Easy to understand: As compared to the machine language it is easier to understand. 2. Easy to remove errors: Because of the codes use English alphabets, its easy to locate and correct errors in an assembly language program. 3. Easy to modify: As the program written in assembly language is easy to understand, it is easy to modify this program as compared to the machine language program. 4. Machine dependent: Assembly language is also considered as low level language because its code is different for different kinds of machine, i.e., the assembly language program is machine dependent program.

Advantages of High Level Language: 1. Understandibility: Programs written in these languages are easier to understand and read than those in assembly and low level languages. 2. Debugging: Debugging simply means to remove errors in a program. Errors in programs written in high level languages are easier to find and remove. 3. Portabiltiy: Programs written for one machine can run on different machines with very minor changes or no changes at all.

PROGRAM TRANSLATORS Since a computer can only understand machine language, any program written in a High level language such as Visual Basic, cannot be executed directly; therefore, it must be first translated to machine language. In order to convert it to machine language a translator is required. There are 3 types of translators used for translating a program written in High level language or assembly language to a form that the computer can execute (i.e., machine code). The three types of translators are: 1. Assemblers 2. Compilers 3. Interpreters. 1. Assembler Assembly language is a low-level programming language in which a mnemonic is used to represent each of the machine language instructions. Assembly languages were developed to make programming easy. Since the computer cannot understand assembly language, however, a program called assembler is used to convert assembly language programs into machine code Source Code Assembly Process Executable Code

2. Compiler The high-level languages are English-like and easy to learn and program. A Compiler is a program that translates a high level language into machine code. The Visual Basic compiler, for example, translates a program written in Pascal into machine code that can be run on a PC. Source Code Compiler Executable Code

Advantages of a Compiler 1. Fast in execution. 2. The object/executable code produced by a compiler can be distributed or executed without having to have the compiler present. 3. The object program can be used whenever required without the need to of recompilation. Disadvantages of a Compiler 1. Debugging (Correcting errors) a program is much harder. Therefore, not so good at finding errors. 2. When an error is found, the whole program has to be re-compiled. Note : A Bug is an error.

3. Interpreter An Interpreter is also a program that translates high-level source code into executable code. However, the difference between a compiler and an interpreter is that an interpreter translates one line at a time and then executes it, no object code is produced and so the program has to be interpreted each time, it is to be run. If the program performs a section code 1000 times, then the section is translated into machine code 1000 times since each line is interpreted and then executed.

Advantages 1. Good at locating errors in programs 2. Debugging is easier since the interpreter stops when it encounters an error. 3. Useful for learning purpose. Note: Debugging is the process of finding and removing errors from a program. Disadvantages 1. Rather slow. 2. No object code is produced, so a translation has to be done every time the program is running. 3. For the program to run, the Interpreter must be present.

Comparisons between Compiler and Interpreter 1. Translates the entire source code into machine code in one go when all the syntax errors are removed, execution takes place. 2. Has capability to store compiled code for future usage. 3. More useful for commercial purposes. 4. Execution time is less. 5. Slow for debugging (removal of mistakes from a program). 1. Translates the source cede line by line, indicated errors at each step every line is checked for syntax error and then converted to equivalent machine code. 2. Cannot retain object code. 3. More useful for learning purpose. 4. Execution time is more. 5. Good for fast debugging.

You might also like