scientific article; zbMATH DE number 400623

From MaRDI portal
Publication:4201894





The book attempts to examine the essential properties of a computer language, to explain how such a language is designed and built, to describe the principles of the programming languages and their implementations. The principles of computations, communication, and good design are stated and used to evaluate various programming language constructs. Examples are selected from Pascal, C, C\(^{++}\), Ada, Prolog, Miranda, Haskell, but also from BASIC, COBOL, FORTRAN, LISP. The authors try to illustrate these principles such that the examples are understandable even by a reader who is unfamiliar with the language involved in. The book is divided in three parts. Part 1 is about language and has four chapters. The first chapter introduces the concept of the nature of language. It presents a language as a communication system, and it draws parallels between programming languages and natural languages. All languages have syntax and semantics. The emphasis throughout the text is on semantics and abstraction. The second chapter, called ``Representation and abstraction, presents how real-world objects, actions and changes are represented through a programming language on a computer. Different set of goals for a language lead to classification of languages. The principles for evaluating a language design are presented. The elements of a language are presented in chapter 3. It presents the correlation between English parts of speech and words in programming languages. Metalanguages accompany languages, allowing to denote their structural units and to refer to their own parts. Chapter 4 discusses formal mechanisms for expressing the syntax and semantics of a language. The syntax of a language is defined using extended Backus-Naur form and syntax diagrams. A language translator converts a program from its source form into a tree representation which gives the structure of the program. The formal semantics defines the meaning of this tree, i.e. the meaning of the program. In order to make language definition portable and hardware independent, the semantics can be defined in terms of an abstract model of the computer. The authors use an abstract machine which is composed of a program environment, shared environment, stack, and streams. The term ``semantic basis of a language defines the specific version of the abstract machine which gives semantics of the language, together with the interval data structures and interpretation procedures which implement the abstract semantic basis. Part 2 is ``Describing computation. Chapter 5 is the first chapter of this part, and is about primitive types. To explain the primitive types supported by languages, the authors present the hardware behind those types. A data type is considered as an abstraction, which define a set of objects and an associated set of functions. A brief history of type declarations is presented. The next chapter creates a framework for describing the semantics and implementation of objects. Such a description is given by declarations, allocation commands, the use of names, the manipulation of pointers. The relationship between storage objects and program objects is illustrated. Initialization and assignment are presented as processes which place a value in a storage object. Three memory management strategies are briefly described: static storage, stack storage and heap storage. Chapter 7 is about ``Names and binding, namely about definition mechanisms, implementation and semantics of names. Binding creates an association between a name and its storage object, giving the meaning of the name. Binding can be static or dynamic. Modularity and block structure limit the scope of a name and can avoid naming conflicts. Interpreters and compilers determine in different ways the meaning of an ambiguous name. The concept of the programming environment and the role expressions in a program are presented in chapter 8. This chapter discusses sequence control and communication, expression syntax, and function evaluation. The next chapter is on functions and parameters. It examines how an argument is passed to a function and various parameter interpretation mechanisms. Some of the applications of higher-order functions and some of the difficulties involved in their implementation are presented. The last two chapters of part 2 deal with control structures. Control structures exist in a variety of forms, from primitive control instructions defined by the hardware to subroutine call with parameters, statement sequence, conditional execution, and repetition. Various conditional forms are discussed from the simplest IF to the CASE statement. Iterative control structures include the infinite loop, conditional and counted loops. Implicit iteration and backtracking are also considered. Global control structures range from the GOTO statement to the control transfer based on higher-order functions, including BREAK statement, labeled loops, continuations, and exception handlers. Part 3 is on ``Application modeling. The first chapter of this part presents the goals and attractions of functional programming. Miranda is presented as a simple powerful and elegant functional language which illustrates the principles and the attractiveness of the functional approach. The next chapter presents the goals and applications of logic programming and the theoretical context in which it was developed. Prolog is presented as an example of an interactive logic language for expressing predicates, relations and axioms. The chapters 14 and 15 discuss the representation and the semantics of types. Simple types, compound types, union types and operations on them are considered. Different approaches to the domains defined by types and to type checking are described. Type casts, conversions and type coercion are explained; a very interesting section describes how these type transformations are implemented in different languages. Type checking is an important aid to the programmer, but it creates an inflexible environment. Some languages provide escape hatches which permit to a programmer to evade the type matching rules. Chapter 16 is on ``Modules and object classes. The purpose and the use of modules are presented and two sections discuss Ada packages and C\(^{++}\) object classes. In the next chapter the authors examine the ways to declare and use generic domains, that is domains which include more than one type of object. They describe how generic domains can be used to express abstractions, to make code reusable, and to support top- down programming. There are various ways in which a domain \(D\) may be generic; parameterized generic domains (defined by a parameterized type), generic subdomain (defined by a subtype), generic domain defined by a polymorphic type, and an ad-hoc generic domain (which includes objects of more than one specific type). Future languages will separate mapping of an object and its domain membership (which are given now together by type). Permitting then this to be defined separately will enable the user to retain the safety of type checking, within a language which can exploit domain relationship. The last chapter of the book presents a systematic way of representing domain relationships and type conversions (by a mode graph), subdomains and class hierarchies, function inheritance, polymorphic domains and functions, languages which support generic and/or polymorphic functions (Haskell, Aleph, Miranda, C\(^{++}\)). A rather selected bibliography and an adequate index end the book. Each chapter contains many and interesting exercises. The book can be used as a textbook for a course in fundamentals of programming languages (teachers, researchers, etc.). I have enjoyed very much while reading the book, and I consider it as a beautiful and useful work.






Describes a project that uses

Uses Software






This page was built for publication:

Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q4201894)