Writing interactive compilers and interpreters, PJ ... - Wiley Online Library

117 downloads 5284 Views 105KB Size Report
practicalities of designing and writing the software. How many books on ... documentation, testing and software installation? ... implementor's desk-a complete ...
100 WRITING

BOOK REVIEWS INTERACTIVE

COMPILERS

AND

INTER-

P. J. Brown, Wiley, Chichester, 1979. Number of pages: 265. Price: E10.75. PRETERS,

This book is aimed at implernentors of interactive language systems and succeeds admirably. Whether the reader is a hobbyist, student or professional programmer there are sections of interest to all. Indeed one suspects that the advice specifically aimed at those new to this area of computing would do well to be heeded by those considered to have long experience! Throughout the text the emphasis is on the practicalities of designing and writing the software. How many books on compilers contain chapters on documentation, testing and software installation? Almost every section contains a ‘deadly sin’ for the programmer to avoid. A copy of the summary of these deadly sins, provided at the end of the book, should be permanently attached to every implementor’s desk-a complete programming standard on a postcard. All aspects of the final interactive system are covered in detail, from the definition of the programming language to be supported to the final execution of the internal form of a user’s program. As one would suspect, a great deal of the book deals with the interactive interface with the user, the key to the acceptability of the whole system. Good advice is given in the important areas of error checking, error messages and program debugging. Where space allows a number of alternative techniques are presented, their advantages and disadvantages explored and one or two solutions recommended. The positive and lucid way in which the information is presented automatically leads to confidence in the author, even if one was not aware of his long and distinguished practical work in this area. For the technically minded, this book forms a useful introduction to the traditional aspects of compilation/interpretation such as: * language design * dictionary and table management * names, scope and data types * memory management * internal form generation In addition, the aspects of the interactive user interface which must be integrated with the above are treated in some detail. These include: *: incremental compiling * editing the user program * error checking * input and output * debugging aids The great benefit of this book is the description of all the above topics within a single volume.

Of particular interest, and perhaps the topic covered in the most detail, is the choice of the internal representation of the user program to be used by the execution module. Various designs are discussed with conciseness and speed of execution as the two main conflicting requirements. In addition, a simple and eminently practical algorithm is presented for recreating the program source from the internal form. Liberally sprinkled with examples and awkward cases, this section of the book epitomizes the great usefulness of this book to real-life implementors as opposed to the academic and theoretical approach of most books on compiling. Throughout the book, a great many practical examples accompany the descriptions of the various techniques and algorithmic solutions. All the examples use the BASIC language in order to reduce the complexity and enhance understandability. Although other languages, including those with block structure, are touched on in the text, very few of the solutions presented in the areas of syntactic and semantic checking would be suitable for languages other than BASIC and its derivatives, e.g. COMAL. This is about the only disappointing aspect of the book. T o some extent this gap is filled by the excellent list of references which for the main part consist of short, illustrative papers describing short algorithms and techniques with direct relevance to interactive compiling. On a wider front there are many aspects of this book which recommend it to the programming world. In particular, the first section on planning forms a comprehensive checklist for any software production project. Apart from the list of deadly sins, the text contains several maxims which beginners would do well to follow, such as ‘Big programs are nothing like small programs. Anyone can write small programs, but you can only write a big program successfully if your practices are good and your standards high.’ In attitude to algorithm selection, too, the author’s advice to tend to the simple and straightforward rather than the ‘efficient’ and error-prone would do well to be copied. Generally, one is left with a feeling that this book should form the core of any course on software engineering. The advent of responsive personal microcomputers has inevitably thrown more emphasis on interactive computing and this book, which states the principles of the subject, will no doubt become a classic of its kind.

M. J.REES Computer Studies Group, University of Southampton