During 1950s--1960s - Compile programs to execute efficiently.
Clarity, simplicity, and unity - provides both a framework for thinking about algorithms and a means of expressing those algorithms
Orthogonality -every combination of features is meaningful
Naturalness for the application - program structure reflects the logical structure of algorithm
Support for abstraction - program data reflects problem being solved
Ease of program verification - verifying that program correctly performs its required function
Programming environment - external support for the language
Portability of programs - transportability of the resulting programs from the computer on which they are developed to other computer systems
Cost of use - program execution, program translation, program creation, and program maintenance
This is the earliest of design criteria, because of small memories and slow
FORTRAN had (has) statements that resembled machine instructions.
|GOTO (10,20,30,40,50),I||FORTRAN's "computed goto"|
|IF(A(I) - MID) 20,30,40||FORTRAN's "arithmetic if"|
|x <<= 3||C's bit pushing operators|
This is the quality of expressivity in a language. Writability should be clear, concise, quick and correct
APL is an extreme case
A <- i 12 p 3 4 results in a 3x4 matrix initialized with consecutive integers:
[1 2 3 4] [5 6 7 8] [9 10 11 12]
LISP has simple, writable syntax in that data structures and program structures use same syntax.
(f a1 a2 a3 ... an)
is the statement and functional syntax
(function name and arguments follow)
(+ 12 total)
(1 2 3 4 (5 6 ) 7 (9 10))) is a data structure that can represent a tree like
structure, nested lists, matrices, etc.
The quality of a language that enables the reader (even non-programmers) to understand the nature of the computation or algorithm.
COBOL is the extreme example
IF NOT-END-OF-FILE-FLAG THEN PERFORM 100-READ-NEXT-DATA-SET VARYING I FROM 1 TO 10 AT END PERFORM 999-UNEXPECTED-EOF.
How fast is the compiler or interpreter?
Pascal is easy
Assurance that a program does not behave unexpectedly.
e.g. array bounds checking
This is the efficiency with which a translator can be written
The ease of which errors can be found and corrected and new features added
This supplants writability.
Consider C++, Java, Ada and Modula-3
The avoidance of special cases and generalizing related constructs into one construct
for i=1..n loop ... end loop
while cond loop ... end loop
Independent functions should be controlled by independent mechanisms
Example of Pascal's data types and input/output (C is similar)
The consistency of appearance and behavior of language constructs
Pascal, for example
keep it simple
The features of a language should not be developed with a bias for a particular machine
Having consistency with accepted notations and conventions
DO 99 I=1.100
The ability to add features to the language
Syntax is defined with BNF and Extended BNF. These well formed definitions are used directly in the translation process.
Attempts have been made to formalize the expression of semantics. This has not made it into the main stream.
These issues will be taken up in the exercises and compiler labs.