[Biojava-l] byte-code generation

Simon Brocklehurst simon.brocklehurst@CambridgeAntibody.com
Tue, 19 Sep 2000 19:49:53 +0100


Matthew Pocock wrote:

Hi Matthew,

snip...

> This involves writing java code. It will work, and will be relatively easy to
> debug. I would prefer to write the bytecode directly, as it leaves less room
> for mess (like where to stoor the temporary files etc.). It can be done - most
> of the java implementations of scripting languages (javascript, tcl, python
> etc.) generate byte-code on the fly to interpret the scripts. Also, the proxy
> class in 1.3 generates byte-code to glue the delegates to the interfaces.

I would agree it's neater and potentially more err... performant, to generate byte
code directly rather than going through intermediate compilations step(s).  The
downside is the amount of effort required to get it to work (depending on the
complexity of what you want to do).  For example, some first generation
cross-compilers to Java byte-code from other languages took the approach I
suggested in order to get products out of the door in a reasonable time-scale.

I guess you've already looked into writing byte-code by hand to come to the
decision that you really want to do this. But in case you haven't - you will need
to get hold of a decent Java byte code assembler from somewhere so that at least
you can test what you're doing makes sense when you're learning/debugging.

If you haven't got your own preferred byte-code assembler, you could conceivably
start with Jasmin (http://www.mrl.nyu.edu/meyer/jasmin/),  but I have absolutely
no idea if it's currently the best one around or not.  This kind of thing is
really more Colin's cup of tea than mine, and he's on holiday at the moment, so I
can't ask.

Simon
--
Simon M. Brocklehurst, Ph.D.
Head of Bioinformatics & Advanced IS
Cambridge Antibody Technology
The Science Park, Melbourn, Cambridgeshire, UK
http://www.CambridgeAntibody.com/
mailto:simon.brocklehurst@CambridgeAntibody.com