REVIEW: Virtual Machine Design and Implementation in C/C++

I read a review on this book on /. and it intrigued me enough to go and plunk down the $60 and take it for a spin. Upshot: what a ride!
Where to start? First off, some background why I chose this book. I have been interested for a while in OS programming, Compilers, VMs, etc for a while. It has exactly zero usefulness to my job, but I just wanted to play with that really low level stuff. I am not sure that I am cut out to *have* to deal with that stuff all of the time, but I always enjoy putzing with it. Linux, Java VMs, they're all too big to really play with (I have no practical C/C++ experience, as my production career has been VB, Web Stuff, and lots and lots of Java.) These huge system have always been a little too daunting for me. Anyway, I found a little OS startup called gazos, but until recently, didn't have a linux box to compile it on, and it would not compile under win32 gcc. Along comes this book, and I tell you, I am thrilled.
I mowed through 300 pages of pretty dry, low-level stuff like it was the funny pages. The book is a good read, and Blunden has constrained the size of the project so that a single person can truly understand all of it.
The really cool thing is that the VM design practically models a real computer, with just a lot less complexity. His VM is register-based and his assembly language (HASM) looks a lot like the instruction sets I remember from college all those years back (just lots and lots smaller.)
He's provided the VM implementation in C, a debugger builtin to the VM, and an assembler written in C++. He's also provided the information necessary to write a compiler that targets the VM. He even illustrates some of how it takes to implement an OO language to target the VM.
The book is broken into three sections: Overview, the VM, and the Assembler. The overview discusses the design constraints, decisions and process. The VM describes the implementation of the VM and debugger. Finally the Assembler section discusses the assembler, the interrupt system, the assembly language, and finally the advanced topics, (such as the OO techniques I mentioned.) I've gotten through about half of the debugger and then I've skimmed the rest. I am really looking forward to finishing this one and to start playing with the VM. Maybe write a compiler for it.... dunno.
Anyway, if you have the interest, but maybe not the desire or time to delve into something as massive as the x86 architecture or the Linux OS or the Java VM, then this is a wonderful place to start.

Comments

Re: REVIEW: Virtual Machine Design and Implementation in C/C++

Very cool, I have been interested in exactly this subject, and you have provided a substantive review, thanks.

Re: REVIEW: Virtual Machine Design and Implementation in C/C++

I'm glad I could help. This comment is mostly a test and I apologize to all the readers out there who took the time out of their day to read it.

RE: REVIEW: Virtual Machine Design and Implementation in C/C++

Yes, Yes, a wanderful book. I like it
very much. I hope it grows to become a
big tree -- a very pratical project, like linux more or least.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.