Читать книгу Concepts and Semantics of Programming Languages 2 - Therese Hardin - Страница 6

Оглавление

Preface

This two-volume work relates to the field of programming. First and foremost, it is intended to give readers a solid grounding in the bases of functional or imperative programming, along with a thorough knowledge of the module and class mechanisms involved. In our view, the semantics approach is most appropriate when studying programming, as the impact of interlanguage syntax differences is limited. Practical considerations, determined by the material characteristics of computers and/or “smart” devices, will also be addressed. The same approach will be taken in both volumes, using both mathematical formulas and memory state diagrams. With this book, we hope to help readers understand the meaning of the constructs described in the reference manuals of programming languages and to establish solid foundations for reasoning and assessing the correctness of their own programs through critical review. In short, our aim is to facilitate the development of safe and reliable software programs.

Volume 1 presented a broad overview of the functional and imperative features of programming, from notions that can be modeled mathematically to notions that are linked to the hardware configuration of computers themselves.

Volume 2 is dedicated to the study of language features (modules, classes, objects) that are known to ease the development of software systems. It builds on the foundations laid down in Volume 1 since modules, classes and objects are, in essence, the means of organizing functional or imperative constructs.

Chapter 1 first analyzes some of the needs of developers in terms of tools for building large software. Based on these requirements, an original semantic model is drawn up, jointly presenting all of the features of modules and classes that can meet these needs. We introduce our own structure, a kit, to describe this model, a word chosen to avoid any confusion with the usual denominations (structure, module, package, class, etc.) used by languages. These kits serve to explain naming management, export and import mechanisms, access restrictions, extension and parametrization (genericity, functors), subtyping and subclassing. In contrast to the mathematical study of semantics of functional and imperative features, the semantics of these kits remains rather informal, as research has not yet led to a relatively simple mathematical model. In this chapter, we have therefore prioritized intuition and simplicity, which inevitably leads to approximations and a lack of rigor, to some degree. Chapter 1 also proposes a set of questions to guide the acquisition of a language, with some answers given in the subsequent chapters. Chapter 2 first presents an implementation of kits with the modules of Ada and then a richer implementation of kits with the modules of OCaml. It ends with a much more succinct implementation of kits, referred to as weak kits, using the header files and the mechanisms of import–export of C. Chapter 3 takes up the kit model to handle classes and objects and their tools, for example inheritance, late binding and subclassing. This model is exemplified in Chapter 4, which presents the classes of Java, C++, OCaml and Python from a unified perspective.

This work is aimed at a relatively wide audience, from experienced developers – who will find valuable additional information on language semantics – to beginners who have only written short programs. For beginners, we recommend working on the semantic concepts described in Volume 1 using the implementations in OCaml or Python to ease assimilation. All readers may benefit from studying the reference manual of a programming language, while comparing the presentations of constructs given in the manual with those given here, guided by the questions mentioned in Volume 2.

Note that we do not discuss the algorithmic aspect of data processing here. However, choosing the algorithm and the data representation that fit the requirements of the specification is an essential step in program development. Many excellent works have been published on this subject, and we encourage readers to explore the subject further. We also recommend using the standard libraries provided by the chosen programming language. These libraries include tried and tested implementations for many different algorithms, which may generally be assumed to be correct.

Concepts and Semantics of Programming Languages 2

Подняться наверх