Monday, February 18, 2008

Classfile

So I've been playing around with developing a module to work with Java class files. Here is the specifications for the file format. If you check out my current files you can see that it's coming along. I'm mainly fighting with the problem of how much calculated data to store in my structure and how much to leave to the methods to generate when it's needed. This is sort of of a battle of lazy vs. immediate evaluation...but not quite.

For instance...A lot of the objects in the structure have length, and index fields into the other parts of the structure. Well, the structure is held together with pointers and lists in memory. The only time those indexes are useful, is when they are converted to binary for the file output. Holding these indexes in memory would add quite a bit of complexity, requiring an update to all affected pieces when another pieces is added, removed of modified. I guess a lot of these decisions will come out later when I start writing the method that writes the structure out to file. Does anyone have experience writing these types of files? I'd be interested in knowing what others have experienced.

Once I am far enough along with this thing, I'll have to start working on understanding the instruction set. This is where I expect the real fun to begin.

No comments: