cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
jcea has quit [Ping timeout: 246 seconds]
glyph has quit [Remote host closed the connection]
glyph has joined #pypy
itamarst has quit [Quit: Connection closed for inactivity]
<cfbolz> korvo: you can do that
<cfbolz> it needs some slightly weird techniques using @specialize.argtype
<cfbolz> and recursion on the tuples
<korvo> cfbolz: It got real mad at `tuple([d.whatever([arr[i] for arr in arrs]) for i, d in unrolling_iterable(enumerate(self.ds)])` and similar attempts to map across rows of arguments. I gave up and hardcoded a version for pairs only, since that's what I actually needed.
<korvo> I'm willing to admit that RPython defeated me today. It happens.
<cfbolz> korvo: write it recursively
<cfbolz> I can try to find an example, but not right this minute
<korvo> It's not a big deal at all. I can't really explain why I'm fighting so much against RPython. Maybe I'm just looking for an artistic outlet.
<cfbolz> korvo: it's a neat puzzle ;-)
<cfbolz> korvo: basically your line needs two changes to work:
<cfbolz> 1) you can't do the list comprehension, because the list elements would be of different types. instead, build the tuple in a regular for loop with `resulttup = resulttup + (d.whatever(...), )`
<cfbolz> korvo: the `unrolling_iterable` function cannot be used at runtime. instead you need to build it at translation time somehow (either via a closure, or an @specialize.memo or something)
<cfbolz> if you show me some more context of your code, I can give it a go
jcea has joined #pypy
itamarst has joined #pypy
jcea has quit [Remote host closed the connection]
slav0nic has joined #pypy
jcea has joined #pypy
mjacob has quit [Ping timeout: 248 seconds]
mjacob has joined #pypy
mjacob has quit [Ping timeout: 252 seconds]
<korvo> cfbolz: I see, thanks. You're welcome to look at my solution; OSDN's not loading, but the module is standalone: https://bpa.st/NNNQ Honestly, I don't feel like working on this more right now and I feel bad asking anybody else to care about it.
mjacob has joined #pypy
<korvo> cfbolz: Oh, I understand my emotions now. This is like a quarter of a Zephyr ASDL compiler and I'm reminded of how much effort it was for so little payout. Beautiful generic code that was only used maybe two or three times.
<korvo> This pairing domain's only used once, to avoid double-parsing when doing both a typecheck and an evaluation in the same action. Lines 72-78 of https://osdn.net/users/corbin/pf/cammy/scm/blobs/master/cammy/repl.py only.
<cfbolz> korvo: let's say that if you get to the point where you would really like to generalize this beyond pairs, please ping me
<korvo> Okay, thanks.
slav0nic has quit [Ping timeout: 265 seconds]
Dagger has quit [Ping timeout: 248 seconds]
Dagger has joined #pypy
Dagger has quit [Ping timeout: 252 seconds]
Dagger has joined #pypy