I've programmed in Java for about 8 years and I know the language quite well as a developer, but my goal is to deepen my knowledge of the internals. I've taken undergraduate courses in PL design, but they were very broad academic overviews (in Scheme, IIRC).

Can someone suggest a route to start delving into the details? Specifically, are there particular topics (say, garbage collection) that might be more approachable or be a good starting point? Is there a decent high-level book on the internals of the JVM and the design of the Java programming language? My current approach is going to be to start with the JVM spec and research as needed.

My personal approach would be (and is) to find the real reason for all that little "why exactly does it work like this" cases in Java. How is auto-boxing defined, how do generic types work. What about var-args? What does the SUPER flag in the class files actually do? Most of that is described in the JVM spec itself, but it requires some work to get it out of there and into your brain ;-)
–
Joachim SauerJun 1 '12 at 12:05

4 Answers
4

I did a bit of this when I started with Java, years ago. My approach was to read the VM spec, and to look at the output of javap -c, which displays the disassembled bytecode of a class. I also tried creating java classes with particular bytecode, using a java bytecode assembler. There is an assembler called jasmin, if you want to try that.

You might also want to look at the Lambda Expression Translation document that Brian Goetz of Oracle has posted, which covers the strategy that will be used to translate the lambdas (closures, essentially) that are being added in Java 8.

Looking into garbage collection is probably a good idea. A quick search turned up this Dr. Dobbs article on Java's garbage-first GC. I don't know if that's a good introduction. I assume you already know about mark-and-sweep and generational garbage collectors; if not, you will want to read up on those first.