Language Design Principles - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Language Design Principles

Description:

Criteria for good programming language design often conflict each other ... Preciseness: having a definition that can answer programmers and implementors questions. ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 11
Provided by: nai3
Category:

less

Transcript and Presenter's Notes

Title: Language Design Principles


1
Language Design Principles
2
Criteria ?
  • It is very difficult to offer criteria for good
    programming language design
  • Criteria for good programming language design
    often conflict each other
  • Programming languages have been successes or
    failures for many different reasons
  • Programming language design is a goal-orientd
    activity

3
Efficiency
  • Efficiency of compiler construction
    implementability
  • Efficiency of compiler execution simplicity,
    reliability
  • Efficiency of program construction writability,
    expressiveness
  • Efficiency of program execution optimizability
  • Efficiency of program modification readability,
    maintainability

4
Regularity
  • Regularity is a measure of how well a language
    integrates its features, so that there are no
    unusual restrictions, interactions, or behavior
  • Regularity can be placed in subcategories
    Generality, Orthogonality, Uniformity

5
Generality
  • Do constructs have as few restrictions as
    possible?
  • In Pascal, functions can be passed as parameters,
    but there are no function variables. C lacks
    nested functions. Scheme and ML have completely
    general functions
  • Fortran can pass variable-length array
    parameters, but cannot define variable-length
    array variables

6
Orthogonality
  • Can constructs be combined in any meaningful way?
  • In Pascal, functions can return only scalar or
    pointer types as values. In C and C, values of
    all types, except array types, can be returned.
    In Ada and functional languages, values of all
    types can be returned

7
Uniformity
  • Do similar things look the same, and do different
    things look different?
  • In C, a semicolon is necessary after a class
    definition but forbidden after a function
    definition
  • In Pascal, returned values from functions look
    like assignments

8
Other Criteria
  • Simplicity make things as simple as possible,
    but not simpler. (Pascal, C)
  • Expressiveness make it possible to express
    conceptual abstractions directly and simply.
    (Scheme, Simula67)
  • Extensibility allow the programmer to extend the
    language in various ways. (Scheme, C)
  • Security programs cannot do unexpected damage.
    (Java)

9
Other Criteria
  • Preciseness having a definition that can answer
    programmers and implementors questions. (Most
    languages today, but only one has a mathematical
    definition ML)
  • Machine-independence should run the same on any
    machine. (Java)
  • Consistent with accepted notations. (Most
    languages today, but not APL)
  • Restrictability a programmer can program
    effectively in a subset of the full language.
    (C avoids runtime penalties)

10
C A Case Study
  • Thanks to Bjarne Stroustrup, C is not only a
    great success story, but also the best-documented
    language development effort in history
  • 1997 The C Programming Language, 3rd Edition
    (Addison-Wesley).
  • 1994 The Design and Evolution of C
    (Addison-Wesley).
  • 1993 A History of C 1979-1991, SIGPLAN Notices
    28(3).
Write a Comment
User Comments (0)
About PowerShow.com