cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
MerlinTheWizard has quit [Ping timeout: 260 seconds]
exarkun has quit [Ping timeout: 248 seconds]
Hasimir has quit [Quit: Vidi, vici, veni]
TheAdversary has quit [Remote host closed the connection]
TheAdversary has joined #pypy
tbodt has joined #pypy
tbodt has quit [Ping timeout: 268 seconds]
dddddd has quit [Remote host closed the connection]
tbodt has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jcea has quit [Quit: jcea]
tbodt has joined #pypy
tbodt has quit [Client Quit]
_habnabit has quit [Remote host closed the connection]
_habnabit has joined #pypy
lritter has quit [Remote host closed the connection]
TheAdversary has quit [Disconnected by services]
TheAdversary has joined #pypy
lritter has joined #pypy
Garen has quit [Remote host closed the connection]
lritter has quit [Quit: Leaving]
JamJam_kid has quit [Ping timeout: 256 seconds]
inad923 has joined #pypy
energizer has quit [Disconnected by services]
energizer has joined #pypy
energizer has quit [Remote host closed the connection]
energizer has joined #pypy
jacob22 has quit [Ping timeout: 256 seconds]
asmeurer_ has quit [Quit: asmeurer_]
marr has joined #pypy
forgottenone has joined #pypy
jamesaxl has joined #pypy
jamesaxl has quit [Ping timeout: 264 seconds]
jamesaxl has joined #pypy
raynold has quit [Quit: Connection closed for inactivity]
antocuni has joined #pypy
marself has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
energizer has quit [Ping timeout: 240 seconds]
antocuni has quit [Ping timeout: 256 seconds]
demonimin has quit [Ping timeout: 260 seconds]
marself has quit [Ping timeout: 256 seconds]
marself has joined #pypy
forgottenone has quit [Read error: Connection reset by peer]
demonimin has joined #pypy
demonimin has quit [Ping timeout: 264 seconds]
demonimin has joined #pypy
demonimin has joined #pypy
dddddd has joined #pypy
lazka has joined #pypy
demonimin has quit [Ping timeout: 240 seconds]
inad923 has quit [Ping timeout: 248 seconds]
jcea has joined #pypy
demonimin has joined #pypy
demonimin has quit [Ping timeout: 268 seconds]
demonimin has joined #pypy
demonimin has joined #pypy
user24 has joined #pypy
<user24> I'm currently trying to build an interpreter with RPython. Right now, the translator thinks the elements of a list i use are not non-negative. How can I make it think they are?
<simpson> user24: You can `assert i >= 0` and then the annotator will be convinced that `i` is non-negative.
<user24> simpson: I tried, but it does not have the desired effect
<user24> (nothing changes)
<user24> maybe my code is too convoluted and confuses it
<simpson> user24: Pastebin or link?
<user24> unpack() essentially decodes the file that contains the runtime binary
<simpson> Hm, it's fine locally, so maybe it's mutated elsewhere. Could you pastebin the RPython exception?
<user24> simpson: Thank you for helping me again. You seem to be everywhere :) https://pastebin.com/yth2jTyA
<user24> ah, I see
<user24> yeah, I modify the list in many places
<simpson> user24: So, first, in terms of reading the exception, the problem is at l85, not l454.
<user24> Is it possible to annotate the type in advance?
<simpson> Note how, on l79 of the traceback, the operations leading up to the problem: v8 = add((9), lencode_0)
<simpson> So it looks like `lencode` could be negative. Indeed, we see that `state` is a list of ints which could be negative.
<user24> yep, that's the list
<simpson> So you probably want to check and handle the case where lencode is negative as an implementation error.
<simpson> assert lencode >= 0, 'Implementation error: lencode was negative!?'
<user24> the elements in the list (the runtime state) should never be negative. is there a way of ensuring the types of its elements without having to assert() on every modification?
<simpson> That is a good question. I'm not sure.
<simpson> You should only have to assert at places where the modification could cause stuff to go negative, but manually finding all of those locations could be a real pain.
<user24> yeah
JamJam_kid has joined #pypy
<user24> simpson: I just noticed that I have to rewrite the thing anyway, since it uses lists of lists/sometimes ints
marself has quit [Quit: WeeChat 1.9.1]
marself has joined #pypy
marself has quit [Client Quit]
ceridwen has quit [Ping timeout: 265 seconds]
<user24> Ok, RPython seems to support lists of lists of integers
<cfbolz> sure does
ceridwen has joined #pypy
demonimin has quit [Ping timeout: 240 seconds]
demonimin has joined #pypy
tbodt has joined #pypy
<user24> cfbolz: but it does not support list(list(int),list(list(int))), right?
<user24> i.e. do elements of the same depth have to be the same type
<cfbolz> yes
<simpson> Lists are homogenous. Tuples are heterogenous, but length matters; they are like product types.
<user24> simpson: okay, thank you both
demonimin has quit [Ping timeout: 260 seconds]
tbodt has quit [Quit: Textual IRC Client: www.textualapp.com]
tbodt has joined #pypy
lazka has quit [Quit: Leaving]
julius has joined #pypy
<julius> hi
<julius> is it true that pypy is not able to use numpy?
<julius> or cant run code that uses numpy?
<cfbolz> julius: no, that's not true
<cfbolz> who says that?
<julius> https://cardinalpeak.com/blog/faster-python-with-cython-and-pypy-part-2/ This means that some third-party libraries that have C extension modules might not work on PyPy—the scientific computing library NumPy is a notable example. Having said this,
<cfbolz> yes, definitely wrong
<julius> ok good
<julius> i ran into problems when using the portable pypy version on ubuntu 18.04: https://bpaste.net/show/bc678b99f2bc will a pypy build from source solve those?
jacob22 has joined #pypy
<__pv> julius: https://github.com/scikit-learn/scikit-learn/pull/11010 --- pypy build won't solve those, needs fixing in scikit-learn
pepesza has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
pepesza has joined #pypy
<julius> ah, thats bad
<julius> im looking for a way to speedup this library: https://github.com/slaypni/fastdtw/tree/master/fastdtw theres a ...cpp file in there, does this mean i should run it with cython?
marself has joined #pypy
tbodt has quit [Ping timeout: 268 seconds]
<user24> At first I didn't like the Mandelbrot thing but now it is such a good reward
raynold has joined #pypy
antocuni has joined #pypy
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 248 seconds]
tbodt has joined #pypy
energizer has joined #pypy
antocuni has quit [Ping timeout: 264 seconds]
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 240 seconds]
<user24> I downloaded a prebuilt pypy binary and use it to invoke translate.py on my interpreter.py. Now I want to use from pypy.rlib.jit import JitDriver, but get: ImportError: No module named pypy Do I have to build pypy from source?
<cfbolz> user24: the tutorial is out of date. It's now rpython.rlib.jit
dddddd has quit [Remote host closed the connection]
<user24> cfbolz: Thank you!
jacob22 has quit [Ping timeout: 256 seconds]
asmeurer_ has joined #pypy
dddddd has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jacob22__ has joined #pypy
exarkun has joined #pypy
<user24> So I went from about 10k instructions/second in a naive python implementation, to 40k/s in naive rust to 4 million/sec in rpython :D
<tos9> that sounds... nice, and super suspicious doesn't it?
<user24> the rust thing yeah
<user24> hm
<tos9> yep
<user24> I profiled it earlier and it's basically 90% mallocs
<cfbolz> user24: the native python was run on PyPy? Or CPython?
<user24> CPython
<user24> the VM is a bit strange. both naive version serialized the entire runtime state _every_ instruction, hence why they are so slow
<user24> (one of the properties of the VM is orthogonal persistence)
<cfbolz> To disk?!
<user24> poor disk :D (no)
<user24> memory only, but that approach is bad enough
<cfbolz> user24: are you keeping the state after every single instruction? Or just the last one
<user24> just the last one. one of the interesting things about it that the VM operates and can be defined recursively (like this: https://gist.github.com/void4/ccbfbf5293c474b971c2a9559cbc0a53), since processes can sandbox other processes.
<user24> And that with resource limits.
<cfbolz> If it's just the last one, the RPython jit will probably nicely recognize that you're not doing anything with the serialized state and remove it in many cases
<user24> for now, I just keep the outermost process in a deserialized state as long as it is running.
dmarasca has joined #pypy
<user24> since inner processes do not have any effects but on themselves, and the system is single threaded and deterministic I can also optimize the tree traversal
<user24> Here's a screenshot of the high level language: https://twitter.com/dd4ta/status/964196870645010433
<dmarasca> Hi! I am working on a Smalltalk VM using RPython and i am having a few issues with long traces. Is there a tool besides jitviewer to view/debug traces? Thanks!
inhahe__ has joined #pypy
inhahe__ has quit [Ping timeout: 264 seconds]
JamJam_kid has quit [Read error: Connection reset by peer]
user24 has quit [Ping timeout: 265 seconds]
kipras is now known as kipras`away