Isolate the most difficult aspects of a programmer's task
Design PLs to meet these difficulties
Why some existing goals are irrelevant
Advantages of high-level languages
Design of a language feature vs. design of a complete language
PL Design Philosophy
What are the most difficult aspects of programming?
program design
programming documentation
program debugging
Other aspects:
machine independence
stability of specification
use of familiar notations
a large and useful library
existing user base
sponsorship by rich and powerful
Discussion of good language design
simplicity
security
fast translation
efficient object code
readability
Important features for a high-level language?
no goto?
support of expressions
separate variables, arrays, and files
can we guarantee that all variables are disjoint and
updating any one of them cannot possibily have any
effect on any other?
Program design --- what a program should do?
Formulating it as a clear, precise, and acceptable specification.
Can we do this today? in which language?
A good programming language should give assistance in expressing not
only how the program is to run, but what it is intended to accomplish;
and it should enable this to be expressed at various levels, from the
overall strategy to the details of coding and data representation.
It should assist in establishing and enforcing conventions and
disciplines that will ensure harmonious co-operation of the parts of a
large program when they are developed separately and finally assembed
together.
What is the purpose of program documentation?
To explain to a human reader the way in which a program works so that
it can be successfully adapted after it goes into service, to meet the
changing requirements of its users, or to improve it in the light of
increased knowledge, or just to remove latent errors and oversights.
A good programming language will encourage and assist the programmer
to write clear self-documenting code.
Program debugging
No machine- or implementation-dependent
effects (security).
Certain programming errors cannot always be detected in this way, and must
be cheaply detectable at run time; in no case can they be allowed to
give rise to machine- or implementation-dependent effects, which are
inexplicable in terms of the language itself.
Definition of a safe program:
programs cannot corrupt the runtime system so that further
execution of the program is not fairthful to language semantics.
The compiler must be utterly reliable and compact and fast.
A necessary condition: simplicity (to the extreme)
The true craftsman thoroughly understands his tools.
Machine and assembly code sets a high standard of simplicity
Discussion of good language design
simplicity
security
fast translation
efficient object code
readability
Simplicity:
modularity and orthogonality are an excellent means to an end,
but not a substitute.
Security (safety): what is a secure language? is he criticizing
dynamically typed language (checkout compiler)?
Fast compilation (important for debugging and for making frequent changes)
Efficient object code: some interesting arguments that language designer
should not ignore machine inefficiency:
the magnitude of the tasks is growing faster than Moore's laws
cheaper and faster
HW pay more attention to reliability
speed, cost and reliability of perpheral equipment is bottleneck
inefficiency from programmer, not from language designer
Optimization has grave disadvantages (reliability, correctness,
unpredictability, removing from programmer his fundamental control and
responsibility for the quality of his programs).
Structuring Arithmetic Expressions E1+E2
transparency of meaning
transparency of purpose
independence of parts
recursive application
narrow interfaces
manifestness of structure
When the operands are too large,
it is better to use updating operations.
Gap between mathematical expressions and programs
Efficiency problem related to diverse applications
Solution: extensible languages
need for an exceptionally efficient base language
no syntactic extension
no automatic type transfer, coercion
Other High-Level Language Features
Program structures (switch to case)
Variables
One of the most powerful and most dangerous aspects of machine-code
programming: each instruction can change the content of any register
or memory location and alter the condition of any peripheral ...
Block structures:
the power of local variables
be absolutely sure that no other part of the program can interfere
with the local variables.
Procedures and parameters --- very important
Types --- compile-time type checking
Language Feature Design vs. Language Design
The difference between designing a language feature (in the context
of a specific language) and designing a language (consolidation not
innovation)