These are chat archives for dropbox/pyston

9th
Dec 2015
An Long
@aisk
Dec 09 2015 15:21
Hi @kmod I saw we can enable the cpython’s ast module easily(with some test case to fix), but another thing is use cpython’s parser not only in repl mode?
Sun
@Daetalus
Dec 09 2015 16:10
Does Pyston has plan to swtich from libpypa to cpython parser entirely?
Sun
@Daetalus
Dec 09 2015 16:22

And how to see the output(like ast structure) of libpypa? The code like:

a = np.array([1,2,3])
a[np.newaxis, :] #libpypa get wrong output of the slice.

When use -x to use CPython parser, it is all fine.

Marius Wachtler
@undingen
Dec 09 2015 17:42
I don't think it makes longterm much sense to have all this parsers in here
I think if we find some issue (like the one I mentioned above) it would make sense to just move to the cpython parser...
but than @kmod added it so I'm not sure if it has currently problems which we need to fix before we can switch too it completely
Sun
@Daetalus
Dec 09 2015 17:51
one problem: if use virtualenv, the src/codegen/parse_ast.pywill not copied to virtual env dir auomatically.
Marius Wachtler
@undingen
Dec 09 2015 17:52
sorry I meant directly using the cpython parser via the C API not the script
Sun
@Daetalus
Dec 09 2015 17:55
I see.
Marius Wachtler
@undingen
Dec 09 2015 18:05
@Daetalus concerning the PyErr_WarnEx if I understood your question correctly: I don't think you should base it on my "frame introspection for exited frames" patch (because it's sadly not ready currently)
does PyErr_WarnEx require something from this patch? or is it just that you need to add this helper function to retrieve the linenumber/globals inside the frame.cpp from the CAPI and you don't want to risk a merge conflict?
Sun
@Daetalus
Dec 09 2015 18:22
I checked your #1007, seems nothing is needed, just want to avoid conflict. Maybe we can create a PR for PyErr_WarnEx for now?
Marius Wachtler
@undingen
Dec 09 2015 18:34
When your ready feel free to put up you PR. If there are merge conflicts with my WIP patch I will resolve them
:-)
Sun
@Daetalus
Dec 09 2015 18:46
Thank you very much! Updating a PR to NumPy. I will create a PR for PyErr_WarnEx tomorrow.
Marius Wachtler
@undingen
Dec 09 2015 18:49
thanks for working on it :-)
jelle van der Waa
@jelly
Dec 09 2015 20:26
First stab at getting Pyston building on arch linux isn't going well ;)
Marius Wachtler
@undingen
Dec 09 2015 20:45
:-(
where are you getting errors?
jelle van der Waa
@jelly
Dec 09 2015 20:46
basically need to teach cmake to use /usr/lib/python2.7
Since now it tries to use Python 3 (so python is python3 on Arch)
For completeness the error:
/usr/include/python3.5m/dictobject.h:132:17: note: expected ‘PyObject {aka struct _object }’ but argument is of type ‘int’
PyAPI_FUNC(int) PyDict_SetItemString(PyObject dp, const char key, PyObject *item);
^
error: command 'gcc' failed with exit status 1
Marius Wachtler
@undingen
Dec 09 2015 20:49
sorry can't help with the build system because I don't know cmake and how to set the correct include paths :-(, but kmod should be around soon
jelle van der Waa
@jelly
Dec 09 2015 20:49
I've made CPYTHON := python2 so I'll try it now
Kevin Modzelewski
@kmod
Dec 09 2015 20:52
oh interesting, yeah I think we usually assume that python is python 2
jelle van der Waa
@jelly
Dec 09 2015 20:52
yeah we're kinda progressive ;)
Kevin Modzelewski
@kmod
Dec 09 2015 20:52
if setting CPYTHON doesn't work, definitely let us know and I'll take a look
@aisk my vote for a plan is to switch to the new cpython parser entirely (the one you get with -X)
when I added it I wanted to make it off-by-default, so it's behind that flag
and there wasn't a compelling reason to make it the default, except for the repl
but I don't think we've seen any issues with it in testing, so maybe it's time to turn it on (especially if we're seeing issues with the pypa parser)
jelle van der Waa
@jelly
Dec 09 2015 20:56
ok, I'll report back with more information later
Kevin Modzelewski
@kmod
Dec 09 2015 20:56
I think "switching to the new parser as the default" can be orthogonal to the ast module though