avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: generating bytecode vs. generating java + compile
Date Thu, 20 Jun 2002 01:36:43 GMT
At 06:19 PM 6/19/2002 -0700, you wrote:
> >>>>> "Peter" == Peter Royal <proyal@apache.org> writes:
>     Peter> If there's one thing I learned from cocoon, its that
>     Peter> dynamic java code generation and subsequent compilation by
>     Peter> invoking javac sucks.
>A deviation from the original topic: how much more difficult is it to
>generate bytecode using BCEL?

depends on how complex the code is. If it is just "wiring" one component to 
another component then it is doable. As soon as you start putting any 
complex logic into the generated code it starts to become a nightmare.

Another problem I had in the past is that sometimes some JVMs will accept 
bytecode that is not valid. Later JVMs would then reject the invalid 
bytecode and it can take a while to debug and figure it all out. Once it 
took me a week to figure out why something failed on one hardware/jvm 
combination but worked fine everywhere else.

So if it is just glue code then it can work but anything else and you are 
just reimplementing a compiler poorly ;)

Then again I don't think the constraint language is a go if it requires 
code generation ;) Someone just sent me the link and grunted is good - 
hadn't looked at it just yet ;P


Peter Donald
"Faced with the choice between changing one's mind,
and proving that there is no need to do so - almost
everyone gets busy on the proof."
              - John Kenneth Galbraith

To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message