Language: The method of human communication, either spoken or written, consisting of the use of words in a structured and conventional way. Any nonverbal method of expression or communication: "a language of gesture and facial expression".
Types of Programming Languages
A programming language is a notation for writing programs, which are specifications of a computation or algorithm.There are many different languages that can be used to program a computer. Programming languages differ from natural languages in that natural languages are only used for interaction between people, while programming languages also allow humans to communicate instructions to machines. There are two major types of programming languages. A computer programming language is a language used to write computer programs, which involve a computer performing some kind of computation or algorithm and possibly control external devices such as printers, disk drives, robots,and so on.
LOW-LEVEL=Closer to Machine's way of thinking
HIGH-LEVEL=Closer to your human way of thinking Why Programming Language?
Actually, some problems are difficult to solve manually. The purpose of using computers is to solve difficult problems. So the computer user must direct all attention on the development of good algorithms for solving difficult problem. After developing good algorithms, the programmer or user have to concentrate the programming language which is understandable by the computer. Computer programming languages are developed with the basic purposes of helping a large number of people to use computer without the need to know the details of internal structure of the computer. Programming languages are matched to the type of operation to be performed in algorithms for different applications. Languages are also designed to be machine independent.
What are the general features of a
programming language?
Simplicity: - Any program should be as simple as possible. Complex statements should be broken up into simplex statements. This increases the processing speed, as the time required to process a simple statement is lesser than a complex statement. Efficiency: - The efficiency of the program lies in quick compilation and execution times. The cost for producing the program and maintaining the program should be controlled. This includes the charges for the programming team for writing, debugging, documenting and maintaining the program. To write an efficient program, the programmer should choose the best algorithm. The logic of the program should be straightforward and complexities should be avoided as for as possible. The program should use the appropriate statements for stating the logic and hence solving the problem. Inputs / Outputs: Any program should have at least one output. There may be programs that need no inputs if the data is supplied within the program. |
|
For which reasons, computer language innovation and development occurs
Innovation and development occurs for two fundamental reasons:
Important aspects of any language
There are four important aspects of any language are the way 1.How does it stores data? 2.The way it operates upon its data 3.How it accomplish input and output 4.How it control the sequence of execution of instructions in a program Trade-offs made when a computer language is designed
When a computer language is designed, the following trade-offs are often made
|
|
The most basic of these is machine language. It is a collection of very detailed, cryptic instructions that control the computer's internal circuitry. This is the natural dialect of the computer. Very few computer programs are actually written in machine language, however, for two significant reasons:
First, because machine language is very cumbersome to work with and Second, because every different type of computer has its own unique instruction set.
Disadvantages
|
Advantage is that program of machine language run very fast because no translation program is required for the CPU.
|
Assembly language is a representation of machine language. In other words, each assembly language instruction translates to a machine language instruction.
Advantage of assembly language
Assembly language programs for a Mac will not work on a PC. But this can be an advantage for programmers who are targeting a specific platform and need full control over the hardware. In other words, assembly language programs are specific to a particular hardware. |
|
Characteristics of Low-Level Languages
|
Usually, a computer program will be written in some high level language, whose instruction set is more compatible with human languages and human thought processes.
Advantages of HighLevel Language
Disadvantage of high-level languages
Characteristics of High-Level Languages
Higher level languages are problem-oriented languages because the instructions are suitable for solving a particular problem. For example COBOL (Common Business Oriented Language) is mostly suitable for business oriented language where there is very little processing and huge output. There are mathematical oriented languages like FORTRAN (Formula Translation) and BASIC (Beginners All-purpose Symbolic Instruction Code) where very large processing is required.
Thus a problem oriented language designed in such a way that its instruction may be written more like the language of the problem. For example, businessmen use business term and scientists use scientific terms in their respective languages. You know that assembly language and machine level language require deep knowledge of computer hardware where as in higher language you have to know only the instructions in English words and logic of the problem irrespective of the type of computer you are using.
Higher level languages are simple languages that use English and mathematical symbols like +, -, %, / etc. for its program construction. You should know that any higher level language has to be converted to machine language for the computer to understand. Rule: A single instruction in a high level language will be equivalent to several instructions in machine language. This generally simplifies the task of writing complete, correct programs. Furthermore, the rules for programming in a particular high-level language are much the same for all computers, so that a program written for one computer can generally be run on many different computers with little or no alteration. |
Compilation (Or) Interpretation
A program that is written in a high level language must be translated into machine language before it can be executed. This is known as compilation or interpretation, depending on how it is carried out.
Compilers: Translate the entire program into machine language before executing any of the instructions. Interpreters: proceed through a program by translating and then executing single-instructions or small groups of instructions. |
However, programs produced by compilers run much faster than the same programs executed by an interpreter.
Interpreter which analyzes and executes each line of source code in succession, without looking at the entire program. The advantage of interpreters is that they can execute a program immediately. A compiler or interpreter is itself a computer program. It accepts a program written in a high-level language as input and generates a corresponding machine-language program as output. The original high-level program is called the source-program and the resulting machine-language program is called the object program. Every computer must have its own compiler or interpreter for a particular high level language. |
Review Questions
|
13.Trade-offs made when a computer language is designed
14. 15.Write about disadvantages of Assembly Language. 16.Define High-Level Language. 17.Write about advantages of High-Level Language. 18.Write about advantages of High-Level Language. 19.Write the abbreviation for the following a) BASIC b) COBOL c) FORTRAN 20.Define Compiler. 21.Define Interpreter. 22.Define Compilation. 23.Define Interpretation. 24.Define Source Program. 25.Define Object Program. |