These are chat archives for dropbox/pyston

16th
Mar 2015
Chris Toshok
@toshok
Mar 16 2015 14:56
are there examples of builtin functions that can return either an int or a long? (or any two different types)
should I just use UNKNOWN for that function’s return type? seems unfortunate
ah yeah, intNeg does exactly that
Marius Wachtler
@undingen
Mar 16 2015 15:44
I think nearly all the int arithmetic function have this behavior and return unknown
and yeah pretty unfortunate :-(
Kevin Modzelewski
@kmod
Mar 16 2015 19:50
str and unicode do the same thing :/
"%s" % u"" is unicode
I think we have good ways to solve these things though, which we haven't even started using
like doing more speculations to have more information during codegen, such as that intNeg returns an int (it only has to promote to long for INT_MIN)
or doing deopt from these kinds of functions (ex irgen requests a version of the function that will either return an unboxed int or deopt if it had to promote)
we currently only using a small number of the tools at our disposal :)