<njs>
I have a situation where I have to generate some annoyingly complicated wrapper classes, and I'm wondering whether pypy has a strong preference between these three main options: https://paste.pound-python.org/show/dAQqrODnpnNw4UjU7JIH/
<njs>
(it's also possible there are other options I'm missing)
<ansichart>
I am trying to build PyPy from source, and I am confused, because the README says to build with "rpython/bin/rpython -Ojit pypy/goal/targetpypystandalone.py" but it shows "/usr/bin/env: pypy: No such file or directory" ... it's trying to use pypy to build pypy, wtf
<tumbleweed>
well if you have a pypy to build it with, it'll go faster
<ansichart>
catch-22
<tumbleweed>
you can use cpython instead
<ansichart>
I was expecting a ./configure script
<ansichart>
ok, I'll use CPython
<tumbleweed>
or start with a pre-build pypy you get from somewhere else
<ansichart>
using pypy to compile pypy just seems funny to me. Like I guess if you're upgrading pypy from new source and you already have it, or building it for another machine
<tumbleweed>
pretty normal for programming languages, they often self-host
<ansichart>
interesting
<ansichart>
i guess if the compiler does fancy optimizations, it can make the compiler itself faster by compiling it with it
<tumbleweed>
if people care enough to build a compiler / interpreter, they probably want to get to use it too
<ansichart>
yea that makes sense now
<ansichart>
Wow this is a very colorful compile script
<ansichart>
somebody was on acid when they wrote this
<njs>
interesting -- in those proxy examples I pasted, on cpython it's option 1 that's the slowest and option 3 that's the fastest, with a factor of ~2x separating them
<njs>
on pypy, option 3 is ~5x faster than option 1, which is ~3x faster than option 2
<njs>
in conclusion, automatically generating code and passing it to exec() is a great idea and we should do it more
<dash>
yes we realized this as well
<dash>
OTOH we're doing it in rpython which is a shade different
<ansichart>
So I understand that CPython creates .pyc files which is bytecode that runs in the Python Virtual Machine... does pypy essentially do the same thing by creates OBJ files, the actual machine assembly code?
<njs>
I wonder if there's some less horrible way to do it via ASTs, because the quoting issues are making me itch
<njs>
ansichart: no, PyPy also generates bytecode that's very very similar to CPython's bytecode, and then executes it on a very very similar virtual machine
<dash>
ansichart: the extra flavor pypy provides is a JIT compiler in the VM which will translate hot loops to native code
<dash>
but cold paths run very similarly to how they do in cpython
<njs>
ansichart: but then there's a mind-bending thing where another piece of code watches what the virtual machine is doing, and if it notices that it's doing the same thing a lot then it generates some native code in memory and starts executing that
<ansichart>
So does that mean that only parts of the byte code is translated to native machine code?
<dash>
pypy has other improvements in the runtime such as a moving gc, better dict implementation, etc
<dash>
ansichart: Right. Generating machine code takes time, so it's only done for code paths where the time savings are likely to be greater than it costs to do the code gen.
<njs>
yes, a given piece of byte code might get translated to machine code 0 times, 1 times, or more than 1 times (e.g. the same python function might be called on both floats and integers, and pypy might compile a separate version for each of these)
<ansichart>
Is it possible to have pypy generate the whole thing into machine code that you can link to an ELF format?
<dash>
ansichart: No, because it generates machine code for a specific trace, which depends on the inputs to the program
<ansichart>
Oh right, because it's a JIT
<simpson>
ansichart: You are still thinking of AOT compilers. JIT compilers have to do their work just before running code; it's the only time when all the data is availbable.
<ansichart>
JIT Compiler*
<dash>
ansichart: it can't generate code ahead of time, because it depends on runtime type information to decide what to generate.
<njs>
huh, and on pypy if I do 'obj.foo = obj._wrapped.foo' in my __init__, then obj.foo() is still about 2x slower than a method that does def foo(self): return self._wrapped.foo(). that's quirky.
<njs>
(in a silly microbenchmark of course)
gclawes has quit [Ping timeout: 245 seconds]
ansichart has quit [Quit: ansichart]
tbodt has joined #pypy
pilne has quit [Quit: Quitting!]
vkirilichev has quit [Ping timeout: 245 seconds]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
asmeurer_ has joined #pypy
fniephaus has quit [Ping timeout: 255 seconds]
fniephaus has joined #pypy
tbodt has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ansichart>
I don't get this bitbucket thing, not clear what the full version string is
<ansichart>
I am at the step of doing "./package.py --archive-name=pypy-VER-PLATFORM" in http://doc.pypy.org/en/latest/build.html, but no where does it specify how to determine what the version is.
<kenaan>
danchr py3.5 86914a929334 /pypy/module/posix/: Fix translation on OS X (and likely FreeBSD as well) BSDs don't provide SCHED_BATCH, so remove the assert that chec...
cstratak has joined #pypy
amaury has joined #pypy
DragonSA has quit [Quit: Konversation terminated!]
cstratak has quit [Quit: Leaving]
cstratak has joined #pypy
mat^2 has joined #pypy
marr has joined #pypy
cstratak has quit [Quit: Leaving]
cstratak has joined #pypy
nimaje1 has joined #pypy
nimaje is now known as Guest38399
nimaje1 is now known as nimaje
Guest38399 has quit [Killed (weber.freenode.net (Nickname regained by services))]
amaury has quit [Quit: Konversation terminated!]
amaury has joined #pypy
mat^2 has quit [Quit: Leaving]
jamesaxl has quit [Read error: Connection reset by peer]
cjwelborn has quit [Ping timeout: 272 seconds]
jamesaxl has joined #pypy
cjwelborn has joined #pypy
cstratak has quit [Quit: Leaving]
jcea has joined #pypy
cstratak has joined #pypy
vkirilic_ has joined #pypy
tilgovi has quit [Ping timeout: 246 seconds]
vkirili__ has joined #pypy
vkirilichev has quit [Ping timeout: 260 seconds]
amaury has quit [Ping timeout: 246 seconds]
vkirilic_ has quit [Ping timeout: 260 seconds]
vkirilichev has joined #pypy
vkirili__ has quit [Read error: Connection reset by peer]
jamescam_ has quit [Remote host closed the connection]
lritter has joined #pypy
<cfbolz>
tos9: I'm about to leave for a long weekend, so offer still stands, but not before Monday / Tuesday
<cfbolz>
Sorry
<Cheery>
it looks like I cannot iterate through RWeakKeyDictionary
<Cheery>
I would like to create finalizers that run at the exit if they don't run before that.
<Cheery>
and thought about implementing them with weak references, but there I got a sort of dilemma.
asmeurer_ has quit [Quit: asmeurer_]
amaury has quit [Ping timeout: 245 seconds]
<tos9>
cfbolz: Cool no worries :)
<tos9>
cfbolz: Enjoy
realitix has joined #pypy
Rhy0lite has quit [Quit: Leaving]
<realitix>
hello fijal, small question (cffi): With ABI mode, when you use set_source, it's only for out-of-line module generation ? You don't need set_source with in-line mode ?
realitix has quit [Ping timeout: 240 seconds]
vkirilichev has joined #pypy
kipras`away is now known as kipras
brent- has joined #pypy
jamescampbell has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jamescampbell has quit [Remote host closed the connection]
marr has joined #pypy
vkirilichev has quit [Remote host closed the connection]
jamesaxl has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
brent- has quit [Remote host closed the connection]
jamescampbell has joined #pypy
jamesaxl has joined #pypy
tbodt has joined #pypy
jamescampbell has quit [Quit: Leaving...]
rmesta has joined #pypy
rmesta has quit [Ping timeout: 245 seconds]
kvil has joined #pypy
realitix has joined #pypy
kvil has quit [Ping timeout: 260 seconds]
arigato has joined #pypy
arigato has quit [Quit: Leaving]
rmesta has joined #pypy
realitix has quit [Quit: Leaving]
jcea1 has joined #pypy
jcea has quit [Read error: Connection reset by peer]
jcea1 is now known as jcea
rmesta has left #pypy [#pypy]
vkirilichev has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
vkirilichev has quit [Remote host closed the connection]