On Fri, 25 Oct 2019 at 04:13, Jonathan Goble firstname.lastname@example.org wrote:
Has anyone already done this that people know of? (Searching the Internetz didn't turn anything up) Failing that, to what extent is it reasonable to either consider assemble() as some kind of sane API point into compile.c
PyPy contains a complete rewrite of compile.c in Python, which should be relatively easy to extract. Here's the py3.6 version: https://bitbucket.org/pypy/pypy/src/py3.6/pypy/interpreter/astcompiler/
Independently, you may also want to benchmark your code on PyPy (*without* using any bytecode generation, just plain Python loops).