cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "the modern world where network packets and compiler optimizations are effectively hostile"
rokujyouhitoma has quit [Remote host closed the connection]
adamholmberg has joined #pypy
slackyy has joined #pypy
yuyichao has quit [Ping timeout: 240 seconds]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 240 seconds]
yuyichao has joined #pypy
mattip has joined #pypy
cstratak has joined #pypy
rokujyouhitoma has joined #pypy
cstratak has quit [Ping timeout: 255 seconds]
rokujyouhitoma has quit [Ping timeout: 260 seconds]
demonimin has quit [Ping timeout: 260 seconds]
demonimin has joined #pypy
demonimin has joined #pypy
yuyichao has quit [Ping timeout: 240 seconds]
yuyichao has joined #pypy
igitoor has quit [Ping timeout: 246 seconds]
igitoor has joined #pypy
vkirilichev has quit [Remote host closed the connection]
igitoor has quit [Changing host]
igitoor has joined #pypy
kipras`away is now known as kipras
Fleche has quit [Read error: Connection reset by peer]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 268 seconds]
david-fb has joined #pypy
<david-fb>
Hello. I am an engineer at Facebook evaluating PyPy as an alternative for some of our production use of cpython.
<simpson>
david-fb: Good plan.
<david-fb>
In the documentation on building from source, packaging step begins with a "cd pypy/tool/release" but I had trouble finding the compents unless I executed the command in the top-level. Is the documentation old or might I have some configuration problem.
<ELFrederich>
whats the best way to expose C enums to Python? Let's say there's an enum called size with small, medium, large, xl and xxl... Would I just do a #define small ..., #define medium ..., etc in a cdef?
vkirilichev has joined #pypy
<xorAxAx>
david-fb: finding which components?
<david-fb>
The primary binary, pypy3-c
<david-fb>
This is not a major issue but I would voluteer to fix the docs if it is stale.
<simpson>
david-fb: Frankly my build process is to use virtualenv and then $(python -mrpython -O2 my_target). No idea whether the docs are suggesting the right thing.
<cfbolz>
david-fb: hey and welcome! it's entirely possible that this is out of date
<david-fb>
I note the basic build from source using cpython is ~ 50 minutes. Even cutting this in half using pypy seems quite painful from an edit-debug perspective. Any wisdom on how to improve this for development? Any caching or other incrementaility that can be enabled?
<cfbolz>
david-fb: when developing you don't recompile that often. all the unit tests don't require compilation
<simpson>
david-fb: Many unit tests can run untranslated; you can iterate on a test without translating.
rokujyouhitoma has joined #pypy
<mattip>
ELFrederich: I have had luck with feeding the string to cdef, then calling lib = ffi.dlopen(None)
<mattip>
and because that is how I found that page :)
<ELFrederich>
mattip: yeah... I guess that will keep them all organized and together in your cdef statement. In that example though color means nothing and RED, GREEN, and BLUE are just ints. In your Python wrapper you'd organize them into an Enum class or something I guess
<mattip>
ELFrederich: you can do stuff like this ffi.string(ffi.cast('enum color', 0))
<ELFrederich>
mattip: interesting, that'll give you the string RED?
<mattip>
yup, and ffi.string(ffi.cast('enum color', 4)) will give you '4', not an exception