Programming Language
A Programming Language is a formal language that specifies a set of instructions that can be used to produce various kinds of output. Programming languages generally consist of instructions for a computer. Programming languages can be used to create programs that implement specific algorithms.
Why we must learn the concepts of programming languages?
- Increase our ability to express ideas
- Improve our background for choosing appropriate languages
- Increase our ability to learn the new languages
- Understand the significance of implementation well
- Use the languages that we are already known better
- And, increase our advancement in computing
Programming Domain
Scientific Applications : Programs tend to involve use of arithmetic on real numbers, arrays/matrices, and “counting” loops. The first high-level programming language for scientific applications was FORTRAN. It was specifically designed for scientific computing. However, most scientific applications are now written in more general programming languages, such as C and C++.
Business Applications : Among the desires here are to do decimal arithmetic (to deal with monetary amounts) and to produce elaborate reports. The first language for business applications was COBOL was designed for this area, and few competitors have ever emerged. Now, Microsoft’s .NET platform is heavily used in business applications running the Microsoft Windows operating system.
Artificial Intelligence : Tends to require symbolic manipulation rather than numeric, use of lists rather than arrays. The first language for artificial intelligence was LISP. However, now Python is one of the most widely used programming languages in the AI field of Artificial Intelligence thanks to its simplicity.
Systems Programming : The first language for systems programming was PL/S (for IBM), BLISS (for Digital) and Extended ALGOL (for Burroughs). However, most system software is now written in more general programming languages, such as C and C++.
Web Software : The World Wide Web is supported by an electic of languages, ranging from mark-up languages, such as HTML, which isn’t a programming language, to general-purpose programming language, such as Java. Typically want good string processing capabilities. Scripting languages such as PHP and JavaScript have become popular here.
Language Evaluation Criteria
There are four language evaluation criteria
1. Readability (Easy to Read and Understand)
There are four characteristics that contribute to the readability
A. Overall Simplicity
The overall simplicity of a programming language strongly affects its readability. Readability problems occur whenever the program’s author has learned a different subset from that subset with which the reader is familiar and have too many features that make the language difficult to learn. The second complicating characteristic of a programming language is feature multiplicity and the third potential problem is operator overloading, in which a single operator symbol has more than one meaning.
B. Orthogonality
Orthogonality is a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures of the languages. Furthermore, every possible combination of primitives is legal and meaningful.
C. Data Types
The presence of adequate facilities for defining data types and data structures in a language is another significant aid to readability. For example, suppose a numeric type is used for an indicator flag because there is no Boolean type in the language.
D. Syntax Design
The syntax, or form, of the elements of a language has a significant effect on the readability of programs. Program appearance and thus program readability are strongly influenced by the forms of a language’s special words. Designing statements so that their appearance at least partially indicates their purpose is an obvious aid to readability.
2. Writability (Easy to Create)
There are three characteristics that contribute to the writability
A. Simplicity and Orthogonality
A smaller number of primitive constructs and a consistent set of rules for combining them (that is, orthogonality) is much better than simply having a large number of primitives.
B. Support for Abstraction
Abstraction is a key concept in contemporary programming language design. This is a reflection of the central role that abstraction plays in modern program design methodologies. The degree of abstraction allowed by a programming language and the naturalness of its expression are therefore important to its writability.
C. Expressivity
Expressivity in a language means that there are very powerful operators that allow a great deal of computation to be accomplished with a very small program. More commonly, it means that a language has relatively convenient, rather than cumbersome, ways of specifying computations.
3. Reliability (Performs Well)
There are four characteristics that contribute to the reliability
A. Type Checking
Type checking is simply testing for type errors in a given program, either by the compiler or during program execution. Type checking is an important factor in language reliability. Because run-time type checking is expensive, compile-time type checking is more desirable.
B. Exception Handling
The ability of a program to intercept run-time errors (as well as other unusual conditions detectable by the program), take corrective measures, and then continue is an obvious aid to reliability. This language facility is called exception handling.
C. Aliasing
Loosely defined, aliasing is having two or more distinct names that can be used to access the same memory cell. It is now widely accepted that aliasing is a dangerous feature in a programming language.
D. Readability and Writability
Both readability and writability influence reliability. A program written in a language that does not support natural ways to express the required algorithms will necessarily use unnatural approaches. Unnatural approaches are less likely to be correct for all possible situations. The easier a program is to write, the more likely it is to be correct. Readability affects reliability in both the writing and maintenance phases of the life cycle. Programs that are difficult to read are difficult both to write and to modify.
4. Cost (Total Cost)
The total cost of a programming language is a function of many of its characteristics. There are seven types of cost. First, there is the cost of training programmers to use the language, which is a function of the simplicity and orthogonality of the language and the experience of the programmers. Second, there is the cost of writing programs in the language. This is a function of the writability of the language, which depends in part on its closeness in purpose to the particular application. Third, there is the cost of compiling programs in the language.
Fourth, the cost of executing programs written in a language is greatly influenced by that language’s design. The fifth factor in the cost of a language is the cost of the language implementation system. Sixth, there is the cost of poor reliability. The final consideration is the cost of maintaining programs, which includes both corrections and modifications to add new functionality.
The cost of software maintenance depends on a number of language characteristics, primarily readability. Of all the contributors to language costs, three are most important: program development, maintenance, and reliability. Because these are functions of writability and readability, these two evaluation criteria are, in turn, the most important.
Influences on Programming Language Design
There are two influences on programming language design
1. Computer Architecture
The basic architecture of computers has had a profound effect on language design. Most of the popular languages of the past 50 years have been designed around the prevalent computer architecture, called the von Neumann architecture, after one of its originators, John von Neumann. These languages are called imperative languages. In a von Neumann computer, both data and programs are stored in the same memory. The central processing unit (CPU), which executes instructions, is separate from the memory.
2. Programming Design Methodologies
A. 1950s and Early 1960s
Simple applications and there was a worry about machine efficiency.
B. Late 1960s and Early 1970s
An intense analysis had begun in large part by the structured-programming movement, of both the software development process and programming language design. People efficiency became important, readability, better control structures.
C. Late 1970s
A shift from procedure-oriented to data-oriented program design methodologies began.
D. Middle 1980s
Object-oriented design began as the latest step in the evolution of data-oriented software development.
Language Categories
There are four languages categories
1. Imperative
Imperative means central features are variables, assignment statements and iteration. The examples are C and Pascal.
2. Functional
Functional means main means of making computations is by applying functions to given parameters. The examples are LISP and Scheme.
3. Logic
Logic means rule-based and riles are specified in no special order. The example is Prolog.
4. Object-oriented
Object-oriented means encapsulate data objects with processing, inheritance and dynamic type binding and grew out of imperative languages. The examples are C++ and Java.
Implementation Methods
There are three implementation methods
1. Compilation
Compilation means programs are translated into machine language includes JIT systems. The translation is slow but the execution is fast. The examples are C, COBOL and Ada. The usage is for large commercial applications.
2. Pure Interpretation
Pure interpretation means programs are interpreted by another program known as an interpreter. The implementation is easy but the execution is slower. The examples are Java Script and PHP. The usage is for small programs or when efficiency is not an issue.
3. Hybrid Implementation System
Hybrid implementation system means a compromise between compilers and pure interpreters. The implementation is easy and faster than pure interpretation. The examples are Perl and Java. The usage is for small and medium systems when efficiency is not the first concern.