These are chat archives for dropbox/pyston

24th
Aug 2015
Sun
@Daetalus
Aug 24 2015 20:42
@kmod Would you mind to give more helps about Daetalus/pyston@b0bef34, please? About how to map llvm::Value to Box*... :smile:
Kevin Modzelewski
@kmod
Aug 24 2015 20:56
ok left a comment
happy to chat more about it :)
Sun
@Daetalus
Aug 24 2015 20:57
Thanks for your patiently reply! And I am updating the complex improvement, maybe need your help too. :smile:
Sun
@Daetalus
Aug 24 2015 21:17
If we use -x to disable pypa, we are using CPython parser?
Marius Wachtler
@undingen
Aug 24 2015 21:18

@kmod you mean the?

if (attr_type == UNDEF)
            attr_type = UNKNOWN;

I just added it because I saw that the handler for other nodes use it

I'm also not sure if the hasFixedOps call is needed
Kevin Modzelewski
@kmod
Aug 24 2015 21:19
oh, interesting
we should probably remove it from all of them then
@Daetalus yep -x gives the old cpython parser
Sun
@Daetalus
Aug 24 2015 21:22
-(1+6j) will give correct result if use -x. But I check the the libpypa output use its astdump.py. The result was correct:
        [Expr]
            - value: 
            [UnaryOp]
                - op: 
                [USub]
                - operand: 
                [BinOp]
                    - left: 
                    [Num]
                        - n: 1
                    - op: 
                    [Add]
                    - right: 
                    [Num]
                        - n: 6j
Kevin Modzelewski
@kmod
Aug 24 2015 21:23
oh hmm marius nevermind, let's just keep it in for now
I think we should be able to remove it
but it looks like augbinop has some issues for now
Sun
@Daetalus
Aug 24 2015 21:23
# CPython
>>> ast.dump(ast.parse("-(1+6j)"))
'Module(body=[Expr(value=UnaryOp(op=USub(), operand=BinOp(left=Num(n=1), op=Add(), right=Num(n=6j))))])'
Kevin Modzelewski
@kmod
Aug 24 2015 21:24
we'd need to encode there that it should look for the non-inplace version if the inplace version returned UNDEF
since for example if it tries to do (1).__ilshift__(2) it will fail since there is no int.__ilshift__
hmm not sure what to say about the parsing
you could try running with -vv to see what our AST looks like
looks like somehow we converted it to 6.000000j+-1
Sun
@Daetalus
Aug 24 2015 21:28
You are correct! Awsome! Here is the output...
>> -(1+6j)
PYPA reading module
Final cfg:
CFG:
1 blocks
Block 0 'entry'; Predecessors: Successors:
    #0 = 6.000000j+-1
Kevin Modzelewski
@kmod
Aug 24 2015 21:33
@undingen reproduced the virtualenv crash :)
had to rm the pip cache and then set the allocbytes to 1M (from 10M)
Marius Wachtler
@undingen
Aug 24 2015 21:33
oh ok thanks, I will try that
Kevin Modzelewski
@kmod
Aug 24 2015 21:40
problem disappears when run in gdb :P
Marius Wachtler
@undingen
Aug 24 2015 21:42
:-D
Kevin Modzelewski
@kmod
Aug 24 2015 23:03
ok I think rudi and I found the issue
Kevin Modzelewski
@kmod
Aug 24 2015 23:15
hopefully #862 will fix it
you can try merging that into your branch