Differences between revisions 3 and 4
Revision 3 as of 2008-11-14 16:39:38
Size: 1302
Editor: c-24-23-228-142
Comment:
Revision 4 as of 2008-11-15 09:15:57
Size: 1302
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

jythonc doesn't handle generators and is difficult to debug and improve. The current thinking is to add capabilites to jython itself to generate bytecode from py files and run those statically compiled items rather than jythonc's approach of making Java classes that work like the base Python code. The current thinking runs as follows:

  • Turn Python classes into Java classes without a Java interface or class using function annotations to specify the static Java type information
  • statically compile proxy classes for Python classes that extend Java classes
  • remove code from core that is only there to support jythonc

The annotation goes on any method in a Python class that needs to be visible from Java and __init__ for the constructor. It's called javamethod since it would be similar to the Python constructs classmethod and staticmethod. Given the following annotated Python class

class Simple(object):
  @javamethod
  def __init__(self):

  @javamethod(String, String)
  def firstWord(self, param):
    return param.split(' ')[0]

Java bytecode corresponding to

public abstract class Simple {

    public Simple(){}

    public abstract String firstWord(String);

}

is generated.

ReplaceJythonc (last edited 2014-05-09 23:39:50 by FrankWierzbicki)