|Writing a C compiler in Java/Jython firstname.lastname@example.org (2001-06-07)|
|Re: Writing a C compiler in Java/Jython email@example.com (2001-06-08)|
|Re: Writing a C compiler in Java/Jython firstname.lastname@example.org (2001-06-10)|
|Re: Writing a C compiler in Java/Jython email@example.com (walter) (2001-06-10)|
|Re: Writing a C compiler in Java/Jython firstname.lastname@example.org (2001-06-14)|
|From:||email@example.com (Mark C. Chu-Carroll)|
|Date:||14 Jun 2001 00:24:32 -0400|
|Organization:||IBM Global Services North -- Burlington, Vermont, USA|
|Posted-Date:||14 Jun 2001 00:24:32 EDT|
firstname.lastname@example.org (Arun Sharma) writes:
> 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
(Note that none of this applies to C-Python. C-Python worked on my
test code extremely well, without the dramatic stack explosion of
"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 (email@example.com)
IBM T.J. Watson Research Center
Return to the
Search the comp.compilers archives again.