














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Programming Languages — Summary. 2. Programming Language Selection and Design. • Choice of best programming language depends on: 1. Intended application.
Typology: Exams
1 / 22
This page cannot be seen from the preview
Don't miss anything!















Benjamin J. Keller
Department of Computer Science, Virginia Tech
And many general principles!
Writeability
Readability — Modifiability and Maintenance
Reliability
Fast translation
Efficient object code
Machine independence
The language should be easy to master
Bad examples: PL/I and Ada — don’t throw in kitchen sink
and (if redundant) development of dialects.If too complex, danger of unexpected interactions, subsetting
Einstein“Everything should be as simple as possible, but not simpler”Can go too far: Basic, LISP syntax.Simple conceptual model of semantics.
restrictions.Few basic features — free from interactions. No special
enumerated types cannot be read or written, etc.simple type, constants only defined for built-in basic types,Example: Problems with Pascal: Function can only return
Algol 68 carries to extremes, everything has value.
well.Smalltalk, Eiffel, other pure object-oriented languages do it
well-written manual.Formal grammar, formal semantics helpful but also need
Original presentation usually too vague. Refined.
ALGOL 68 problem with redefining terms.
discovered.Syntactic and logical (semantic) errors discouraged and easily
Related to writeability, readability, and modifiability.
Static checks
Separate (but not independent) compilation
Minor modifications should not require major changes.
Problems: Ada out params, Pascal variant records, side-effects.Clear semantics supporting verification.
Simplicity of compiler implementation.
Fast translation can only be an asset.also simple to parse for the human programmer, and that A language that is simple to parse for the compiler is
(^) — Wirth
Efficient Object Code — So people will use program
Machine independence — hard to achieve completely.
(^) Abstraction
: Avoid requiring something to be stated more than
once; factor out the recurring pattern.
(^) Automation
: Automate mechanical, tedious, or error-prone
activities. (Provide higher level features, e.g. DO loop)
(^) Defense in Depth
: If an error gets through one line of defense,
DO, varieties of GOTO in FORTRAN)incorrect but syntactically ok, then should fail type-checking:then it should be caught by the next line of defense. (e.g. if
(^) Information Hiding
: Modules should be designed so that: (1)
nothing more.information needed to implement the module correctly, andcorrectly, and nothing more. (2) The implementor has all theThe user has all the information needed to use the module
(^) Labeling
: We should not require the user to know the absolute
labelled case as opposed to unlabelled)with any position that must be referenced elsewhere. (E.g.,position of an item in a list. Instead, we should associate labels
(^) Localized Cost
: A user should only pay for what he uses; avoid
parameters)simple things are expensive, e.g ALGOL DO, defaultdistributed costs. (Don’t build in so much generality that
(^) Manifest Interface
: All interfaces must be apparent (manifest)
in the syntax. (Clear how to use, no side-effects)
(^) Orthogonality
: Independent functions should be controlled by
control).independent mechanisms. (Avoid dependencies, e.g. logic and
(^) Portability
: Avoid features or facilities that are dependent on a
particular machine or a small class of machines.
(^) Syntactic Consistency
: Things which look similar should be
similar and things which look different should be different.
(^) Zero-One-Infinity
: The only reasonable numbers in
(Avoid special cases, E.g. compound commands in Pascal.)programming language design are zero, one, and infinity.
jobs course!).FORTRAN, PL/I, LISP, APL, SNOBOL, etc. (languages forOriginally survey of programming languages: COBOL,
languages.Get better understanding of principle features of programming
Explore design space of programming languages.
reflected by different programming language paradigms.Introduce different ways of thinking about programming
(b) Functional: Expanded expression constructs. Pattern verification. ML as an example.implementation on highly-parallel computers). ProgramImplementation issues (efficiency and possibility ofvs. eager languages. Recursively defined types.matching and type inference. Higher-order functions. Lazy
(c) Logic: Basis in mathematical logic — extract program from
Use of cut. Closed-world assumption and negation.and control (sort of). Importance of ordering of clauses.Relation to resolution theorem proving. Separation of logiccomputations). Computation as backtracking + unification.proof. Relational programming (and reversability of