On May 7, 2008, at 8:08 AM, Fabrizio Milo aka misto wrote: >>> Doesn't "if it ain't broken, don't fix it" apply here? > The fact is that it actually breaks with Python 3.0 :)
Yes, this is true. Actually modifying the parser to accept, for example, decorators will be easy. With statements are already implemented at the parser level, as are inner functions (just have to remove the line disallowing them). Parameterized types shouldn't be too hard to do either. For about every 2.x deficiency I can think of modifying the parser is going to be by far the easy part of the job. I am not aware of any huge changes in 3.0, but there may be some. If we decide to replace the parser, I would like to see one that's automatically generated from a grammar file (rather than hand coded) and lends itself well to optimization when we compile cython with itself (as parsing is a huge portion of the total runtime). > I see three solutions: > 1) > to copy main parts of pypy's parser and put them inside cython > * Pro: > more easily to modify and clean > specialized for cython purpose > * Cons: > duplicate code among libraries This seems like the best idea, depending on how much code we are talking about here, and also as long as there aren't any license issues. > 2) > main parser logic from the pypy repository > compatibility layer inside the cython repository > > * Pro: No code duplication > * Cons: Cython dependent of another library I really don't want to increase dependancies, and I have the feeling that the "compatibility layer" wouldn't be very clean. > 3) Tell to pypy's guys to create a python parser library for python > from pypy's parser > and both cython and python use it. > They will have python 3k support as well as cython I'm not sure why they would to this for us, and would we rely on them to do it repeatedly as the language changes? > I will try to do my best in working on this parser. > > What do you think ? > > Fabrizio I don't think the discussion would be complete without at least looking at the possibility of using the parser that comes with Python itself. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
