This may interest you. (wrt Jython 3)

Jonathan Revusky <[email protected]> Sat, 16 Oct 2021 15:19:31 +0200
Newsgroups gmane.comp.lang.jython.devel
Message-ID <CAL_ve4dznFDshg+FV9DHq7UeQdato8MiCXBfaJFknyrqA0dHqQ@mail.gmail.com>
Greetings.

First of all, I have no idea how many people will receive this message.
And, of those who do receive it, I have no idea how many people would be
interested. That said, I think that for anyone interested in jump-starting
development on a Jython 3.x, the information below could be of great
interest. So, here goes...

First of all, JavaCC 21 <https://javacc.com/> is a continuation of
development of the venerable JavaCC parser generator released by Sun
Microsystems back in the 90's. One could call it a "fork" but in reality,
at this point, it is basically a complete rewrite. For the last few months,
my main collaborator on the project has been Vinay Sajip, who is a
committer on the CPython project. His main focus has been on reworking the
JavaCC 21 codebase to be able to support generating parsers in Python -- a
PythonCC if you will. And, actually, that subproject is in quite an
advanced state and Vinay blogged about it here:

https://blog.red-dove.com/posts/parsing-in-python/

Actually, the above-linked post is from a couple of months ago and there
has been some further progress. For one thing, the Python parser included
in JavaCC 21 now supports the 3.10 grammar, not 3.9. To get a more concrete
feel of what we're talking about, here is the current Python grammar
included in JavaCC 21:

https://github.com/javacc21/javacc21/blob/master/examples/python/Python.javacc

The above-linked grammar file generates a parser that automatically builds
an AST.

Now, as best I can guess, the biggest, or certainly one of the biggest,
problems with Jython development must be maintaining an up-to-date
grammar/parser for the language. So here's the real pitch, I guess. The
JavaCC 21 project is committed to doing that for you. As part of the
subproject of developing a PythonCC, i.e. a version of JavaCC 21 that
generates parsers in Python code, we are committed to maintaining an
up-to-date grammar/parser for Python code. And, to be clear, in case
anybody misunderstands. This is not pie-in-the-sky. This already exists.
The parser generated from the above-linked grammar file parses every Python
source file you throw at it and builds an AST.

Now, I'm loath to get into too much of a "hard sell" but I would put it to
you that, since the JavaCC 21 project is doing this work already, I have to
think it would be totally win-win for you guys to leverage what we've done
for a Jython 3. You win obviously because we're doing the heavy lifting on
maintaining the language support as it evolves forward, but we also win
because we get some serious stress testing of this ongoing work.

Or, in other words, you guys could just rely on us to handle the parsing
side and you can concentrate on the actual run-time internals and bridging
the Java and Python object models basically.

Well, I'll close this note here. If you have any questions or comments, by
all means fire away.

Thanks,

Jonathan Revusky
lead developer JavaCC 21 project, https://javacc.com/

_______________________________________________
Jython-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-dev