antocuni changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "PyPy: the Gradual Reduction of Magic (tm)"
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tayfun26 has quit [Remote host closed the connection]
tayfun26 has joined #pypy
amaury has joined #pypy
jacob22_ has quit [Ping timeout: 264 seconds]
<jneen>
cfbolz: haha i see. i'm actually working on a different lang right now, but it looks like i'll probably want to go through the ffi for some string stuff
<cfbolz>
jneen: ah, cool! Which language is that? Or still secret?
<cfbolz>
the pieces that are needed for a decoding stream are all there, somehow. But so far the main rpython language that does Unicode stuff is pypy, so there's not a lot of useful code in rlib (yet)
<fijal>
cfbolz: we're also trying to make rutf8.py more generally useful
<fijal>
(on branch currently)
<cfbolz>
Cool
<fijal>
so yes, maybe that
<cfbolz>
fijal: but I suppose it doesn't do much for you if you're using the RPython unicode type?
<fijal>
nope
<fijal>
but maybe you shouldn't :)
<cfbolz>
Weeeell
<cfbolz>
That's an open question, at this point
<fijal>
yeah
<jneen>
really?
<jneen>
hmm ok
<fijal>
jneen: we're experimenting with using UTF8 internally in pypy
<fijal>
(as opposed to UCS4)
<jneen>
oh neat
<jneen>
that would be cool
<jneen>
the lang i'm working on now is for my master thesis
<jneen>
i'm trying to solve the shell design problem :|
<jneen>
i.e. something that's usable as a unix shell but also suitable for large programs
<jneen>
the more i develop it the more it seems like the unix process model is (abstractly) actually a pretty nice way of specifying parallel programs
<jneen>
(i'm first-classing channels, environments, pids, and signals)
<jneen>
buuuut i'm parsing it by hand because barewords are *hard*
<njs>
jneen: btw, are you familiar with xonsh?
<jneen>
yep
<jneen>
xonsh's goal is more to provide python integration
<jneen>
er, s/goal/strategy/
<jneen>
this is a language to itself, with abstractions that stay very close to unix concepts
<jneen>
the goal being to have almost no conversion overhead on the part of the user for interacting with external programs
<jneen>
as long as those programs are built to work with stdio, return codes, and signals
<arigato>
what result would you expect from doing this?
<jneen>
an unencoded byte string?
<jneen>
certainly not ascii encoding
<cfbolz>
Yes, but what encoding then?
<cfbolz>
UCS-4? utf-8?
<jneen>
i see
<arigato>
you can't fit arbitrary unicode code points in a *byte* string because codepoints don't fit bytes
<jneen>
right, i always forget python's unicode() is unencoded
<arigato>
maybe you mean u'xxx'.encode('utf-8')?
<cfbolz>
jneen: it works differently in Ruby, right?
<arigato>
python's unicode() is not "unencoded" as much as it's a list of arbitrary codepoints
<jneen>
cfbolz: it only sort of works in ruby. there's a global default encoding that works if you only use utf8
<cfbolz>
Heh
<jneen>
arigato: that's pretty much what i mean. there's no embedded encoding
<jneen>
like, a string is a bytestring together with an optional encoding specifier
<jneen>
so you never have a list of codepoints independent of an encoding
<jneen>
though you can re-encode a string manually
<jneen>
or forcibly override an encoding (if you have a bytestring whose encoding you happen to know)
<cfbolz>
No, it's a bit different still. A str is really a list of bytes, with no implicit or explicit encoding. A unicode is a list of codepoints, again with no encoding. Only when you convert between those two do you need to specify an encoding
<jneen>
oh jeez
<jneen>
(what i described is how i understand ruby btw)
<cfbolz>
Right
<jneen>
and in python 3...?
<fijal>
same
<jneen>
hm ok
<fijal>
except "str" is a list of codepoints and "bytes" is a list of bytes
<fijal>
note that it's similar to what would happen in ruby if you said "ascii" as the encoding
<jneen>
ahhh i see
<jneen>
it was just renamed
<jneen>
and unicode made default
<fijal>
yeah
<fijal>
and implicit conversion was removed
<fijal>
so in python 2 you can say u"foo" + "bar"
<fijal>
and it would convert "bar" to unicode using ascii
<fijal>
that does not work in py3
<jneen>
or in rpython, so
<fijal>
in rpython that's illegal too I think
jcea has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
<mattip>
something is wrong with win32 py3.5 cffi modules
<mattip>
it is building them OK in lib-pypy as _pypy_openssl.pypy3-510-AMD64-win32.pyd, but "import _pypy_openssl" fails
<jacquerie>
oh, you're the author of pdbpp? thanks for that!
<antocuni>
you're welcome :)
<antocuni>
pdbpp is a "pypy fault": I used to debug a part of pypy which contains a lot of variables named "r", but if you type "r" at (Pdb) prompts, it resumes the execution. So, I started pdb++ just to avoid that :)
guilherme has joined #pypy
<xorAxAx>
how does it handle the variable ll? :)
<antocuni>
pdb++ gives precedence to variables over commands
<xorAxAx>
ah, ok
<antocuni>
but you can force the command by typing "!!ll"
forgottenone has joined #pypy
mat^2 has quit [Quit: Leaving]
guilherme has quit [Ping timeout: 265 seconds]
tayfun26 has quit [Remote host closed the connection]
<antocuni>
cfbolz: I looked at cpyext-faster-arg-passing, it looks nice and reasonable
zmt00 has joined #pypy
<antocuni>
I am wondering whether it would be better to add a method "get_cpy_ref_fast" to W_Root
<antocuni>
this way, we can remove the ifs inside realize() and as_pyobj(), and it also provides a nice hook if we want to implement it for more types
jacquerie has quit [Quit: Ex-Chat]
Nizumzen has quit [Ping timeout: 240 seconds]
dddddd has quit [Ping timeout: 265 seconds]
Jellyg00se has quit [Quit: Leaving]
<cfbolz>
antocuni: yes that's what I do in the unpushed commit that's sitting on my laptop ;-)
<antocuni>
cool :)
dddddd has joined #pypy
<cfbolz>
antocuni: also using that mechanism to do the same for types, None, bools
<antocuni>
did you also measure performance for all those cases?
<cfbolz>
antocuni: not yet
<antocuni>
if you do, please send a PR to my benchmarks repo
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
guilherme has joined #pypy
<cfbolz>
antocuni: will do
guilherme has quit [Ping timeout: 256 seconds]
Nizumzen has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
jcea has quit [Quit: jcea]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholm_ has joined #pypy
adamholmberg has quit [Ping timeout: 265 seconds]
dddddd has quit [Ping timeout: 260 seconds]
guilherme has joined #pypy
dddddd has joined #pypy
guilherme has quit [Ping timeout: 248 seconds]
adamholm_ has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Read error: No route to host]
<mjacob>
ronan: you mean one in lib_pypy and one as a mixed module?
<ronan>
yes
<mjacob>
if you ask me, all hashing modules in lib_pypy (there are more) should die
guilherme has quit [Ping timeout: 256 seconds]
guilherme has joined #pypy
<mjacob>
why are they there in the first place? i guess only guess
<mjacob>
i guess it was easier to take some existing pure-python module, modify it a bit and put it in lib_pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ronan>
maybe we could vendor stuff from cryptography?
<ronan>
like we already do for _ssl
<mjacob>
have a look at lib-python/3/hashlib.py to see where the hashes come from
<mjacob>
it tries to get the hashes from openssl first (except for blake2b and blake2s)
<mjacob>
if that's not possible, it tries to get them from _md5, _sha3 etc.
<ronan>
oh, so we don't actually use them, do we?
<mjacob>
note that some newer algorithms are not available in all openssl versions
<mjacob>
older ones like md5 are of course always available from openssl
<mjacob>
see also the commented out hashes in py3.6's hashlib.py
<mjacob>
(definition of __always_supported)
guilherme has quit [Remote host closed the connection]
guilherme has joined #pypy
tormoz has joined #pypy
<ronan>
pfff, it's a mess I don't want to get into right now
<mjacob>
that's what i thought as well and then i stopped digging ;)
<mjacob>
from a quick look it seems like cryptography only uses openssl's hashes and doesn't implement them itself
guilherme has quit [Ping timeout: 256 seconds]
tbodt has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
<mjacob>
ronan: why did you ask, btw?
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
<kenaan_>
rlamy py3.5 404dc45db8ca /pypy/module/imp/test/test_app.py: Try to make test_builtin_reimport_mess() clearer and fix it Note: _md5 was a builtin module in -A tests only, so use...
<ronan>
mjacob: because of this ^^^
dcrosta has joined #pypy
guilherme has joined #pypy
realitix has quit [Quit: realitix]
<kenaan_>
rlamy py3.5 ff0600c50bee /pypy/: kill __pypy__.save_module_content_for_future_reload(), it does not do anything (probably maybe)
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 265 seconds]
drolando has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kenaan_>
cfbolz cpyext-faster-arg-passing fc3f8f9e8b75 /pypy/: refactor to use methods
<kenaan_>
cfbolz cpyext-faster-arg-passing 5187eda5bf36 /pypy/module/cpyext/: generalize the code and store py_obj references in types, bools, and None