Preface
The study of programming languages at the advanced undergraduate or graduate level usually covers two main areas: principles of language design and two or three different programming paradigms. Texts for this study tend to fall into either of two categories:
1) concept-based surveys of a wide range of language design topics and paradigms; and
2) interpreter-based treatments of the design principles presented in a functional language.
APPROACH
This text attempts to unite the best features of these two approaches into a single and co-herent framework. Like the interpreter-based texts, we include a rigorous, complete, and hands-on treatment of the principles using a formal grammar, type system, and denotational semantics, including an interpreter that implements the formal model. In contrast with these texts, we use Java as the language of illustration rather than a functional language. Like the concepts-based texts, this text presents and contrasts the major language design topics and programming paradigms. Unlike the concepts-based texts, we hope to cover this material in a more modern and coherent fashion.Our approach is based on the belief that a formal treatment of syntax and semantics, a consistent use of the mathematical notations learned in discrete mathematics, and a hands-on treatment of the principles of language design are centrally important to the study of programming languages. This approach is advocated, for instance, in the design of the Programming Languages course in the Liberal Arts Model Curriculum Walker 1996], and is also consistent with the recommendations of Computing Curricula 2001 [CC 2001]. The concepts-based texts seem to have foregone such rigor in recent years in favor of surveying an increasingly wide variety of topics and languages. The topics that should be central to a students understanding of language principles and paradigms, such as the formal treatment of semantics, are usually presented late in these texts, as one of many unrelated topics, and in a way that encourages instructors to skip them altogether. We think that a study of programming languages principles should integrate these topics in a more compelling way.
With regard to Computing Curricula 2001 [CC2001], the material in this text covers all the topics (PL1 through PL11) in the Programming Languages section of the core body of knowledge. It also covers other topics in that core body of knowledge, such as event-driven and concurrent programming (PF6), memory management (OS5), and functional and logic programming (IS). However, this text generally treats these topics in greater depth than that suggested by Computing Curricula 2001.
Our treatment of syntax and semantics includes the use of BNF grammars and a formal denotational approach to type systems and semantics. This approach is fully illustrated, so that the theory can be explored by students with the aid of a Java interpreterthat directly implements the formal semantics. This approach allows students to study all the dimensions of language design using the available formal tools: BNF grammars, abstract syntax, recursive descent parsing, and functional definitions of type systems and meaning. Asmall imperative language that we call Jay is used as a basis for illus-trating the principles of language design and formal methods. Java is used throughout Chapters 25 as the implementation language for exercising the syntax, type-checking, and semantics functions of Jay.
Another point of departure from the concepts-based texts is that we have tried to focus on a single language per paradigm. We believe that a deeper understanding of each paradigm is more important than a survey of the many languages that support it. Often the same problem is solved in each paradigm so that an instructor can better illustrate the differences between the paradigms.
Java is ideally suited to supporting most of the topics in this text. It is a widely popular language, designed in a more principled way and containing a richer collection of features than most of its predecessors. This versatility allows Java to be used in most of the lab exercises and illustrations that accompany this text. So we use Java for the imperative, object-oriented, event-driven, and concurrent programming paradigms. We use Scheme and Haskell for the functional paradigm, and Prolog for the logic programming paradigm. Why two languages for functional programming? Scheme represents a more traditional, widely used Lisp-like functional style which cannot be summarily overlooked. However, Haskell contains several contemporary featureslazy evaluation, list continuations, and a strong and versatile type systemthat set it apart from the traditional functional programming style, and thus merit its separate inclusion. As a practical matter, we recommend that instructors cover only one of these two languages in the functional programming part of the course.
We have extended the discussion of formal semantics into some of the paradigm chapters as well. That is, the run-time semantics of Jay are reimplemented in the object-oriented, functional, and logic programming chapters. This strategy provides more coherence for the book overall by working out a single substantial example in each of several different programming styles.
Another thread that can be followed through the book is formal correctness of programs. Axiomatic correctness of imperative programs is treated in Chapter 3. Both the chapter on object-oriented programming and the one on functional programming contain a section on formal correctness.
Beyond the standard paradigmsimperative, object-oriented, functional, and logic programmingthis book identifies two other paradigms: event-driven programming and concurrent programming.
Event-driven programming characterizes programs that respond to events arriving in an unpredictable sequence, rather than controlling a priori the sequence in which these events occur. The most dramatic current examples of the event-driven paradigm are those programs written for Web-based interactionsonline registration and electronic commerce applications, for example. But event-driven programming is a more mature paradigm than these recent applications suggest. It also appears in programs that are embedded in vehicles, operating systems, networks, and home alarm systems. We are convinced that this paradigm is sufficiently mature and distinctive from the others that it can no longer be ignored in any study of programming languages that presumes to cover the major paradigms.
![]()
feedback form | permissions | international | locate your campus rep | request a review copy
digital solutions | publish with us | customer service | mhhe home
Copyright ©2001 The McGraw-Hill Companies.
Any use is subject to the Terms of Use and Privacy Policy.
McGraw-Hill Higher Education is one of the many fine businesses of the The McGraw-Hill Companies.