From: Samuele P. <pe...@in...> - 2000-10-19 12:19:21
|
Hi. I have subscribed to the sourceforge lists and so I have received the last mail from Finn (twice). Have I missed something in between? at the moment there is no archive access. Things seem to get clearer both for semantic and possible implementation up to Barry inputs. [Finn] > Right, I think I understand now. The list of module would then look > like: > > module_list = ['x', 'x.y'] > > and the code that look for java packages would then look like this: > > if module_list != None: > if modName in module_list: > # here modName is not a java package, so there > # is no need to try an expensive forName(modName) > # across the network. > return null > // do normal java package load here. Yes, that is what I meant and it should solve the performance problem. As I wrote java package load should deal also with sys.path java loading (semantic: virtually sys.path is appended to CLASSPATH) and main "problem" is to handle sys.path more dynamic nature. I clarified to myself that jythonc should build the list, use the new order dealing with imports but it is not necessary that it find out that a py pkg is also a java pkg :). The modified runtime support can deal with this. But there is another issue: I have not yet analyzed it in depth. One can compile a set of py modules/py pkg under a user-defined java pkg (package jythonc option) so for example py mod x.y will be userpkg.x.y. If the code in interpreted mode load a java class x.JClass what should do at runtime the same code when compiled and put in the pkg userpkg, just still try to load x.JClass or userpkg.x.JClass, try both. In any case something like java.lang.* should still be loaded as java.lang.*. Can we separate the different cases? What is the more coherent semantic that can be actually implemented? regards, Samuele PS: as I wrote, all the compiler.*Maker should not use Class.forName. I noticed that AdpterMaker is also used by jythonc so we should pay attention. |
From: Samuele P. <pe...@in...> - 2000-10-19 12:30:26
|
Sorry, I read Finn mail too quickly. I think the point is clear but better to clarify: [Finn] > Right, I think I understand now. The list of module would then look > like: > > module_list = ['x', 'x.y'] > > and the code that look for java packages would then look like this: > > if module_list != None: > if modName in module_list: > # here modName is not a java package, so there > # is no need to try an expensive forName(modName) > # across the network. > return null > // do normal java package load here. My idea for the import logic is as follows: if modName in module_list: load compiled modName class else: do sys.path py loading unless sys.path is empty do java package load here (both classpath and sys.path) regards, Samuele. |
From: <ba...@wo...> - 2000-10-19 13:18:58
|
>>>>> "SP" == Samuele Pedroni <pe...@in...> writes: SP> Things seem to get clearer both for semantic and possible SP> implementation up to Barry inputs. I've got the raw old archives, but I'll need to make a SF admin request to get them merged in. I'll get to answering the meat of this thread as soon as possible, but there are a couple of other things I need to clear off my plate first. -Barry |
From: <bc...@wo...> - 2000-10-19 15:45:11
|
On Thu, 19 Oct 2000 14:19:19 +0200 (MET DST), you wrote: >I have subscribed to the sourceforge lists and so I have received the last mail >from Finn (twice). >Have I missed something in between? Not from me. >Things seem to get clearer both for semantic and possible implementation >up to Barry inputs. > >... > >I clarified to myself that jythonc should build the list, use the new >order dealing with imports but it is not necessary that it find out >that a py pkg is also a java pkg :). The modified runtime support >can deal with this. I can make this change. Py.initProxy will then get a new "String[] modules" argument. I'll make it a patch,, i.e I will not commit this until we have settled the complete semantic change. >But there is another issue: I have not yet analyzed it in depth. > >One can compile a set of py modules/py pkg under a user-defined >java pkg (package jythonc option) so for example py mod x.y >will be userpkg.x.y. > >If the code in interpreted mode load a java class x.JClass what should do >at runtime the same code when compiled and put in the pkg userpkg, >just still try to load x.JClass or userpkg.x.JClass, try both. x.JClass IMO. The --package option to jpythonc should only be for the generated code, not for the entire world. >In any case something like java.lang.* should still be loaded as java.lang.*. >Can we separate the different cases? What is the more coherent semantic that >can be actually implemented? regards, finn |