PL DESIGN (1) leave it to the compiler - design the language such that the compiler does most of the problem solving, testing, etc. (2) make the progammer say once, at most LANGUAGE DESIGN CRITERIA (1) expressive power classes: C, C++, Java strings: Fortran, C, Perl (2) well-defined syntax and semantics - no implementation dependence variable initialization divide by zero (3) reliability - ability to detect syntactic and logical errors multiple occurrences of the same information - in C #include "myinclude.h" myfun(myargs); lexical incoherence - in Pascal program longDist(input, output); var result: int; (* HUGE PROCEDURE *) begin result = 10.5; end. (4) fast translation - how many passes example in C int f2(int); // WHY? int f1(int x) { f2(x); } int f2(int x) { /* some code */ } (5) efficient object code - make the programmer supply as much information as possible x[a++] in C (6) orthogonality non-interacting features: "0.000" in Perl interaction of string <-> num conversion & value & boolean no redundant features: a++ in C comments in C, C++ (7) Machine independence: especially primitive types Java (8) Consistency with commonly used notions, "law of least surprise" 25 + 1/3 = 5.333333 9 < 8 < 7 in PL/1 (9) subsets - "what you don't know won't hurt you" (10) correctness & standards Horowitz's 10 steps to design a language (1) choose an application area // will be given (2) make the design committee as small as possible // 3 (3) choose some precise design goals (4) release version one to small set of people (5) revise language definition // design project (6) build a prototype compiler (7) revise language definition again (8) write the manual // write reports (9) write a good compiler and distribute it (10) write primers