cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
<mattip>
why do we have lib_pypy/_ctypes_test.c and extra_tests/ctype_tests/_ctype_test.c
<mattip>
and they are different?
<danchr>
here's an idea for how to adjust the pypy search path logic:
<danchr>
1) add an extra translation option libdir
<danchr>
2) if it’s set and the executable isn’t named `pypy-c`, _always_ default to a module search path of $libdir:$libdir/lib-dynload:$libdir/site-packages (in whatever order)
<danchr>
3) rely on the code in site.py to handle venv, etc.
<danchr>
would that work
<danchr>
?
<mattip>
is this similar to what CPython does?
<mattip>
we should be trying to move closer to 100% compatibility
<danchr>
I believe CPython — in version 3 at least — implements most of the import logic in python
<danchr>
pmp-p: ah, that's an “interesting” approach — neat and a bit horrible at the same time :)
<mattip>
where does that sets the bootstrap search path for site-packages?
<danchr>
mattip: in cpython?
<mattip>
yes
<mattip>
it is compiled using Programs/_freeze_importlib.c
<danchr>
I think that's done in Modules/getpath.c
<mattip>
which has as a top comment "This is built as a stand-alone executable by the Makefile, and helps turn Lib/importlib/_bootstrap.py into a frozen module in Python/importlib.h
<mattip>
both PyPy and CPython use Lib/importlib/_bootstrap.py, there should be no difference
<danchr>
is there an easy way to translate a minimal but functional pypy?
<mattip>
you can run untranslated on top of cpython2
<mattip>
python2 pypy/bin/pyinteractive.py
<mattip>
it takes about ~30 secs to start up on my machine
<mattip>
and has some builtin modules
<mattip>
you can add more with python2 pypy/bin/pyinteractive.py --withmod-XXX
<mattip>
get help with python2 pypy/bin/pyinteractive.py --help
<mattip>
ctrl-c will drop you into the RPython interpreter, where you can examine "space" (among other things)