From: Ype K. <yk...@xs...> - 2001-03-08 22:46:12
|
Originally alreadu sent to: John, >Any thoughts about developing a tool to convert Jython to Java? Unlike >jythonc (which is a great tool!), something to ease the job of porting >to Java in order to get better performance. > >I'm porting code by hand now. It's pretty mechanical. And the >performance gain is dramatic. If only it wasn't sooo tedious. > >BTW, after spending hours adding braces and semicolons and "new" and >*obvious* data types, etc. to transform Jython to Java, I now think of >Java as simply Jython dressed in drag. (Not that there's anything >wrong with that!) Try adding changing a method of an object in Java to remember the differences.... Seriously, in case you will have to spend many more hours dressing Jython in drag, you might consider getting your hands on the Python pretty printer module and change its output to do a lot of the work for you. You'll spend some hours before becoming productive, though. Ten years ago I would have used /usr/bin/sed to do a thing like this. It might still work, too. I never got to know awk in depth, but it might even be better. Some alternatives: Try and use a profiler to determine which code to move to Java first. Where is that Jython profiler anyway? Also it is quite possible to create a Java superclass for your jython classes. This allows you to concentrate on the time critical methods first, instead of moving whole classes at a time. Actually I think creating Java superclasses and doing a bit of manual profiling in Jython is the most effective use of your time. Normally 80-90% of time is spent in 10-20% of the code. Good luck, Ype |