Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Compiler design : virtual machines
Wilhelm R., Seidl H., Springer Publishing Company, Incorporated, Berlin, Germany, 2011. 187 pp. Type: Book (978-3-642149-08-5)
Date Reviewed: Dec 16 2011

This book covers the design and implementation of virtual machines (VMs) (also called abstract machines) for four distinct programming language paradigms: imperative, functional, logic, and object-oriented. It is not for someone interested in studying VMs such as those from VMware or Xen, nor does it describe VMs used in language implementations such as Java, C#, and Haskell.

This volume is a part of a planned four-volume series, with each volume devoted to a specific compilation sub-task. For example, Volume 3 will cover static program analysis. According to the introduction, the series is meant to be an extensive revision of Wilhelm and Maurer’s Compiler design [1].

After a brief introductory chapter, chapter 2 describes C-Machine (CMA), a suitable VM for imperative programming languages. This VM is designed to be a target language for translating a subset of the C programming language. The authors carefully describe the virtual machine’s architecture and instructions. The chapter’s structure roughly follows a sequence from simpler C expressions to more complex C statements, carefully explaining translations from C to the target machine language.

The color diagrams provide additional descriptions of each machine instruction operation on the runtime stack; these are clear and helpful. The book provides many clear code generation examples, each with the right level of detail to explain the salient points of a translation. Each chapter ends with an extensive set of exercises designed to help the reader work through additional translation schemes that add more power to the C language subset.

Chapter 3 is devoted to functional programming languages, exploring them in the FUL language (which has some OCaml-like syntax and semantics). Programs in FUL are translated onto the target machine MaMa. Diagrams show both stack and heap operations. The MaMa machine operations and the provided translation schemes from FUL support applicative order, normal order, and lazy (or call-by-need) evaluation. Sprinkled throughout the chapter are sections that discuss various straightforward optimizations: last calls, global variables, and the construction and management of closures.

Chapter 4 covers logic programming languages. The core language is PROL, a subset of Prolog; it is meant to be translated onto WIM, a virtual machine. The sections follow a sequence from simple matters (that is, term allocation on the heap) to backtracking (with special registers used to restore the stack and heap state), to queries and programs. The authors provide several optimizations and describe an extension to WIM that is suitable for implementing cuts. This is perhaps the most complex chapter of the book as it reflects the complexity of WIM. That being said, the writing is clear and well organized, and motivated readers will find all the information they need to attempt an implementation.

The last chapter focuses on an object-oriented extension of C. The language is a single-inheritance subset of C++, and the authors have attempted to keep modifications to CMA to a minimum. This relatively short chapter addresses issues such as multiple inheritance.

This book brings to mind Aït-Kaci’s beautifully written work [2], which the authors cite. Both texts are short, written in a spare and clear style, and thoughtfully sequenced for motivated readers. This book even contains some flashes of humor (for example, a throwaway comment about a functional language program’s role in an obfuscated C code contest).

The only flaw is the somewhat curious layout: many pages have one-line text orphans interspersed between figures, which interferes with the flow of reading. The authors make no claims about the intended audience, and I am unsure whether this text is suitable for an undergraduate introductory course on compilers. However, for anyone interested in compilers and code generation for modern programming language implementations, this book is a must-read.

Reviewer:  Michael Zastre Review #: CR139685 (1205-0442)
1) Wilhelm, R.; Maurer , D. Compiler design. Addison-Wesley Publishing Co., Reading, MA, 1995.
2) Aït-Kaci, H. Warren’s abstract machine: a tutorial reconstruction. MIT Press, Cambridge, MA, 1991.
Bookmark and Share
 
Compilers (D.3.4 ... )
 
 
Run-Time Environments (D.3.4 ... )
 
 
Reference (A.2 )
 
Would you recommend this review?
yes
no
Other reviews under "Compilers": Date
An architecture for combinator graph reduction
Philip John J., Academic Press Prof., Inc., San Diego, CA, 1990. Type: Book (9780124192409)
Feb 1 1992
Crafting a compiler with C
Fischer C., Richard J. J., Benjamin-Cummings Publ. Co., Inc., Redwood City, CA, 1991. Type: Book (9780805321661)
Feb 1 1992
A methodology and notation for compiler front end design
Brown C., Paul W. J. Software--Practice & Experience 14(4): 335-346, 1984. Type: Article
Jun 1 1985
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy