- Shopping Bag ( 0 items )
The Guts of Java
Here at ERCB, we've received at least a dozen shelf-feet of Java books for review from various publishers, but on close inspection many of them are merely warmed over C/C++ programming books by the usual stable of C/C++ programmer-authors. Since mass-market Java programming tools are such a recent phenomenon, very few of the books are based on serious Java programming experience or address the development of non-trivial, non-toy applications. Still fewer address topics beyond the basic Java programming language or delve beneath the surface of the Java application framework -- in fact, this is the first one I have seen that provides any substantive information about Java pseudo-code and the virtual machine at all.
The first part of The Java Virtual Machine Specification is composed of a somewhat redundant overview of the Java programming language, a introduction to the Java Virtual Machine architecture, and a detailed description of the Java class-file format. The body of the book is devoted to the Java virtual machine opcodes, which are discussed one at a time with their binary representations, stack effects, side effects, exception conditions, and miscellaneous programming notes. The last section covers compiling Java source code to pseudocode, with examples, as well as threads, locks, and some Sun-JVM-specific pseudocode optimizations (which amount to self-modifying opcodes).
Technologically, this is an important book. But as its title indicates, it was designed to be a specification, not a tutorial, so it's tough sledding for the most part and it will be useful mainly as a reference. The hands-on, blow-by-blow description of implementing and debugging a Java Virtual Machine on a mainstream CPU has yet to be written (although I wouldn't be too surprised to learn that Andrew Schulman is already working on it!). The sections of The Java Virtual Machine Specification concerned with code compilation and especially code validation are quite interesting, however, and are well worth your time.
In the Preface, the authors comment that "We intend that this specification should sufficiently document the Java Virtual Machine to make possible compatible clean-room implementations." Did the authors attain this goal? As a past implementor of commercial Forth interpreter/compilers and cross-compilers on many different CPUs, I'm dubious. Forth is based on a virtual machine architecture not terribly dissimiliar to Java, but I don't think I could program my way directly to a working JVM that would run any ol' Java applet I found on the Internet, using just the information supplied here. The descriptions of "frames" and the class loading/linking process are a bit too abstract, and the authors take for granted a fairly deep understanding of C++ implementation strategies. Additionally, a number of machine-dependent issues are not mentioned at all. For example, the mapping of Java-level graphic operations onto machine- or system-specific graphic APIs -- and how such calls from the AWT are passed through or around the JVM -- is left completely to the imagination.
Still, this book is the only game in town at this point for developers of Java compilers, JVMs, and Java debuggers.--Dr. Dobb's Electronic Review of Computer Books