These are chat archives for dropbox/pyston

18th
Mar 2015
dkuner
@dkuner
Mar 18 2015 15:57
This message was deleted
Marius Wachtler
@undingen
Mar 18 2015 17:35
type_anaysis.cpp: should'nt the visit_functiondef() and visit_classdef() functions call mangleName(node->name) when passing the name to doStore()?
also is it safe for visit_functiondef() to set the type to typeFromClass(function_cls) if the functiondef has decorators?
Travis Hance
@tjhance
Mar 18 2015 18:16
hm... should we just have names already mangled in the AST that gets passed to type analysis?
Marius Wachtler
@undingen
Mar 18 2015 18:22
mmh could be, but then I find it's not obvious where the CFG nodes get modified. interpreter + irgen mangle the name
Travis Hance
@tjhance
Mar 18 2015 18:27
I thought scoping_analysis mangled the name
Marius Wachtler
@undingen
Mar 18 2015 18:31
you are right, but it looks like it does not mangle the name of functiondefs and classdefs in place
Chris Toshok
@toshok
Mar 18 2015 19:02
I want to say @rntz and @kmod were talking about this the other day (with @rntz working on it)
Kevin Modzelewski
@kmod
Mar 18 2015 19:51
I think marius you're right about both
we mangle AST_Name id fields in scoping_analysis
but not functiondefs or classdefs
due to a limitation in the way we represent them
where we only have space for storing a single name
but if a functiondef/classdef name has mangling applied, we have to create the object with the unmangled name (which I think is visible in __name__), but store it to the mangled name
and we don't have the ability to represent something like "name = functiondef"
so for now you're just supposed to mangle the names of class and functiondefs any time you want to use them
and yeah, it shouldn't set the type to typeFromClass(function_cls) if there are decorators, good catch :)
Marius Wachtler
@undingen
Mar 18 2015 20:00
makes sense
I was wondering about this stuff because I'm tracking down an error when running pip with enabled jit
Kevin Modzelewski
@kmod
Mar 18 2015 20:03
oh, interesting
you can also try disabling type analysis
you could try modifying type_analysis.cpp::doTypeAnalysis() to just return the NullTypeAnalysis
Marius Wachtler
@undingen
Mar 18 2015 20:04
good idea :-)
Kevin Modzelewski
@kmod
Mar 18 2015 20:05
yeah unfortunately we don't have any checks for whether the type analysis was actually correct
including codegen-level annotations
we have checks for runtime annotations now
Marius Wachtler
@undingen
Mar 18 2015 20:09
:-(
should I prepare a patch for the type_analysis stuff? (mangling and not returning function_cls when decorators are set?
Kevin Modzelewski
@kmod
Mar 18 2015 20:11
yeah that'd be great :)
Marius Wachtler
@undingen
Mar 18 2015 20:58
I'm having trouble coming up with a test case for this issues, could you think of one?
Kevin Modzelewski
@kmod
Mar 18 2015 21:04
it looks like we don't make use of the information that something is a function
since functions can have instance attributes and that currently blocks the optimizations (though it doesn't need to)
Marius Wachtler
@undingen
Mar 18 2015 21:11
ok so I should just get this in without a test?
Kevin Modzelewski
@kmod
Mar 18 2015 21:32
I feel like we should be able to test the mangling part
trying to put together a test...
Chris Toshok
@toshok
Mar 18 2015 21:33
very strange. fasta.py fails for me on master, but not on my tuple-colocate branch
not sure how that’s possible
Kevin Modzelewski
@kmod
Mar 18 2015 21:35
class C():
    def f():
        def __f2():
            print "hi"

        if 1:
            pass
    f()
(also I think these issues also apply to classdefs?)
@toshok heh that's strange
Chris Toshok
@toshok
Mar 18 2015 21:36
very. considering my branch is exactly 1 commit ahead of HEAD
Marius Wachtler
@undingen
Mar 18 2015 21:42
@kmod thanks for the test
Travis Hance
@tjhance
Mar 18 2015 21:48
I can’t figure out gitter notifications
I’m using the desktop app and have notifications on for all messages
but I never actually get notified
Kevin Modzelewski
@kmod
Mar 18 2015 21:53
@toshok well I think fasta is failing due to a GC issue? so I guess it could be anything
Chris Toshok
@toshok
Mar 18 2015 23:10
@tjhance on osx? I get growl-esque notifications with the desktop client
Travis Hance
@tjhance
Mar 18 2015 23:10
hm I got one this time, but maybe only b/c you tagged me
say something without tagging me
Chris Toshok
@toshok
Mar 18 2015 23:11
something without tagging me
Travis Hance
@tjhance
Mar 18 2015 23:11
odd, it just seems to be working now