From: Arno P. <ar...@pu...> - 2009-11-27 07:37:54
|
certainly an interesting idea. I would caution against cross-compiling everything from Harmony. I haven't looked at their implementation but I would suspect that classes like String, ArrayList, HashMap are completely written in Java. Cross-compiling these would result in a severe performance penalty, that is why we currently map them (via categories) to their Objective-C counterparts (NSString, NSArray, NSDictionary). But I'm sure there are many other cases where cross-compiling Harmony would make a lot of sense. Lets begin by discussing a JNI-like interface for Objective-C. That is something we need anyways at some point. Once we have that, we can discuss which parts of Harmony we cross-compile. Anyone want to chip in with ideas regarding JNI for XMLVM? Arno Gergely Kis wrote: > Hi, > > We are porting a fairly complex J2ME / Android application to IPhone > using XMLVM, and I had an idea to speed up the process. Instead of > implementing every necessary class from the Java Runtime by hand, I > pulled in the Apache Harmony runtime implementation from the Android > platform and got to the point where it compiles to Java Bytecode. Now > XMLVM happily produces cross-compiled Objective C code from it, but of > course there are a number of native methods that need to be implemented. > XMLVM treats native methods simply as abstract methods. > > The idea is to change the XSL, so it generates a dummy body for the > native methods, probably throwing an UnsupportedOperationException() or > something similar. > Then for those classes that are actually used by us, we can go ahead and > implement the native methods using the nice "Categories" feature of > Objective-C, without the need to touch the generated source code. > > Of course, we plan to use the hand optimized versions of those classes > that are available. For low-level classes, like threads, we plan to > implement the Thread class directly using NSThread. But there are many > classes, that are seldom used (exceptions) or are only interfaces, or > simply they are not yet available in a hand optimized version. In these > cases we are able to fall back to the cross-compiled version. > > What do you think? > > Would you be interested in this solution? > > Best Regards, > Gergely > > -- > Kis Gergely > MattaKis Consulting > Email: ger...@ma... <mailto:ger...@ma...> > Web: http://www.mattakis.com > Phone: +36 70 408 1723 > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |