Skip to content
Isaiah Peng edited this page Jun 18, 2016 · 4 revisions

Current status

-Working on posix compatibility, specifically the _posixsubprocess module, with JNR- Rewriting _socket module with jnr-unixsocket, to replace the current netty version.

Close to zero effort is spent to gain performance, CPython compatibility is the only focus at the moment, that means java interop could be broken at some point.

Things that doesn't make sense

Builtin modules are types, instead of modules, i.e.

>>> import _io
>>> type(_io)
<type 'java.lang.Class'>
>>> _io
<type 'builtins._io'>

Roadmap

Changes that are not necessarily hard but involes a lot of work.

  1. Create PyBytes that inherits from BaseBytes to replace the current PyString as bytes type. At the moment there are so many usages of PyString as str.

  2. Changes all PyInteger usage to PyLong. Currently both are used, and kind messed up.

  3. Be compatible with CPython on the __next__ and __findattr__ methods.

Currently the java __next__ method returns null as a sentinel for StopIteration, the idea is good, but it doesn't work in practice, such that most of the implementations are actually like:

@Override
public PyObject __next__() {
    try {
         return object___next__();
    } catch (PyException e) {
         if (e.match(Py.StopIteration)) {
             return null;
         }
         throw e;
    }
}

It totally defeat the purpose.

So is __findattr__, it returns null instead of raising Py.AttributeError.

asyncio support

Implement subprocess module with JNR, this is the basic module for multiprocessing, which is used by concurrent and the later is used by asyncio.

It could be an interesting project to implement the asyncio event loop with netty.

invokedynamic

Once almost all specs are passing or ignored by the @test.support.cpython_only decorator, I'll start working on invokedynamic support, hopefully then we can remove all the derived classes, and the java wrapper methods and have better performance.

Clone this wiki locally