From: Gergely K. <ger...@ma...> - 2009-11-27 10:14:47
|
Hi, 2009/11/27 Arno Puder <ar...@pu...> > > 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. > > I agree completely. In the original mail I mentioned NSThread as an example. In fact I am planning to change the code generation process to only include the classes from Harmony in the output that have no manually written counterparts. Also, while as a first step I just copied all of Harmony, I will most probably remove a large chunk of it that we don't use currently to minimize the overhead. > 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? > My suggestion (as I wrote in the original mail) is to just use Objective-C categories to write the necessary methods. A similar method is used in GWT with JSNI. Of course there you write the Javascript code in comments inside the Java classes, but here we have the power of ObjC and can separate the native methods from the cross-compiled methods into separate files easily. Best Regards, Gergely -- Kis Gergely MattaKis Consulting Email: ger...@ma... Web: http://www.mattakis.com Phone: +36 70 408 1723 |