> All,>> I wanted some opinions from people who might have attempted this in> the past: Writing a C compiler in Java. Also, would using a scripting> language like python (specifically the jython implementation of the> language) have any advantages in writing optimization algorithms ?

While the simple expressiveness of python can be a huge help in
implementing experimental algorithms, the Jython implementation
should be avoided for any serious work.

I'm working on a software configuration management system, where I'm
writing the bulk of the system in Java. I spent some time
experimenting with alternative delta computation and storage
algorithms, which I implemented in Python. The way that Python handles
data structures, particularly hashes and tuples, made the code
dramatically simpler to read and write.

However, when I tried running the code using Jython, I ended up
running out of stack space, even with huge stacks, on not very large
examples. When I spent time probing, the problem turned out to be that
the Jython implementation effectively made multiple nested calls for
each direct python call, and that was blowing up the stack.

I've done some further experiments, and concluded that Jython is
wonderful for adding simple scripting to your application, but that it
cannot reasonably be used for large applications or complex
algorithms.

(Note that none of this applies to C-Python. C-Python worked on my
test code extremely well, without the dramatic stack explosion of
Jython.)

-Mark
--
"There's nothing I like better than the sound of a banjo, unless of
course it's the sound of a chicken caught in a vacuum cleaner. "
Mark Craig Chu-Carroll (mcc@watson.ibm.com)
IBM T.J. Watson Research Center