jastrachan | 6 Oct 09:58 2004

[groovy-dev] making the bytecode generation more understandable

The groovy implementation consists of a few different pieces

* the GDK classes in groovy.*
* new groovy methods added to Java types, mostly in 
* runtime classes to perform dynamic method invocation etc
* the parser
* the language AST
* the bytecode generator

Most of this is all fairly straightforward Java code. The complex parts 
are the parser, which Chris has done a good job to make comprehensible 
and the bytecode generator stuff which is currently a bit of a big ball 
of mud and pretty cryptic stuff.

At some point soon, I'd like us to experiment writing an alternative 
implementation of ClassGenerator which uses a Java AST instead to hide 
the complexities of the bytecode. Current possibitilies include...


Both of which look more comprehensible than the current ASM code. I'm 
hoping once the bytecode generation code is easily understandable, we 
can add all kinds of optimisations to generate static method 
dispatching whenever we can etc.