<mattip>
I wonder if we could come up with a definition of a C-API that would be not too slow on PyPY
<mattip>
any type of iterating through a tuple/list/dictionary will force a strategy change to PyObject from int/float/string, so that would be the first thing to avoid on my list
<mattip>
Maybe defining use cases:
<mattip>
- I have a pile of battle-tested c code, how do I call it quickly from python? Use CFFI
<mattip>
- I have some slow python code, I want to make it fast? Use PyPy natively, or use cython
<mattip>
Are there more use cases?
<mattip>
ahh, there is the "numpy" one:
<mattip>
- I have a data structure that is a bad fit for pure python, and PEP-3118 is not good enough, let's use NumPy as a data structure container
<mattip>
i.e. opencv, tensorflow. But I think that is not a very well defined (or wrongly defined) use case
<LarstiQ>
- I want to use Python as a scripting language inside my non-python based project
<mattip>
LarstiQ: what do you want to pass back and forth?
<mattip>
just embedding is "easy", the problems start when you want to get something into or out of the embedded interpreter
<LarstiQ>
mattip: e.g. Blender, Civilization, Maya. Not so much about back and forth but control
<LarstiQ>
and the Python C API is what people reach for
<mattip>
civilization http://sthurlow.com/python/ "scripting code will be in python, and the game data in XML"
<mattip>
so that seems doable via passing strings without needing deep PyObject creation
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
chelz has quit [Ping timeout: 268 seconds]
chelz has joined #pypy
<arigato>
cfbolz: yes, it makes sense to push it forward
<cfbolz>
Cool
<cfbolz>
arigato: we should also brainstorm ideas for the list strategy issue at some point
<cfbolz>
#2881
Zaab1t has joined #pypy
adamholmberg has joined #pypy
dddddd has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
<arigato>
yes, but unsure what we can do
marky1991 has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 246 seconds]
Zaab1t has quit [Ping timeout: 250 seconds]
Zaab1t has joined #pypy
adamholmberg has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
marky1991 has quit [Remote host closed the connection]
adamholmberg has quit [Remote host closed the connection]
<cfbolz>
arigato: there are mitigation ideas. eg using prebuiltints would solve the problem for not too large ints. or we could use a LRU cache for ints when not in the jit
marky1991 has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
Rhy0lite has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
solarjoe4 has joined #pypy
squeaky_pl has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
adamholmberg has joined #pypy
antocuni has joined #pypy
marky1991 has quit [Ping timeout: 246 seconds]
squeaky_pl has quit [Remote host closed the connection]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
raynold_ has joined #pypy
<_aegis_>
I embed python in my app as the primary scripting language and I found it MUCH nicer to write low level C APIs and do the python object wrangling in python instead of in C
<_aegis_>
(pypy -> cffi -> my C API) instead of (python -> cpython api)
<_aegis_>
this is after originally writing it against the cpython 2 api, porting it to cpython 3, then porting it to pypy
raynold_ has quit []
<_aegis_>
(pypy for performance, as I have some code that runs very often forever)
<cfbolz>
_aegis_: cool
antocuni has quit [Ping timeout: 268 seconds]
<cfbolz>
_aegis_: if you ever feel like writing a blog post about your experience, we would love to have it for the PyPy blog
antocuni has joined #pypy
antocuni has quit [Ping timeout: 268 seconds]
themsay has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
themsay has quit [Ping timeout: 246 seconds]
Zaab1t has quit [Quit: bye bye friends]
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Ping timeout: 250 seconds]
Rhy0lite has quit [Quit: Leaving]
marky1991 has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]