Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython
Stefan Behnel, 22.03.2011 08:59: Robert Bradshaw, 22.03.2011 08:14: On Mon, Mar 21, 2011 at 11:10 PM, Stefan Behnel wrote: Reimplementing existing C modules in Cython might, however, be more interesting for python-dev, but also be a larger undertaking. So a GSoC might be worth running on that. I think that's a great idea. Would you be willing to mentor such a project. As usual, I'm not sure I'll have the time, but if no-one else steps up, I'd consider it. Should we sign up with the PSF GSoC umbrella to officially propose this project? https://spreadsheets.google.com/viewform?formkey=dHh3WFNGYzkyWWE0ZjM1eFFoUUVGWmc6MQ Do we have any other topics for the GSoC this year? We'd be just in time if we discuss this at the workshop, although somewhat late already. The student application deadline is from March 28 to April 8. http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2011/timeline Stefan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Bug report: lambda and numpy.vectorize segfaults
2011/3/24 Stefan Behnel : > Vitja Makarov, 23.03.2011 20:11: >> >> 2011/3/23 Stefan Behnel: >>> >>> Vitja Makarov, 23.03.2011 17:25: File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", line 2307, in p_c_arg_decl if 'pxd' in s.level: AttributeError: 'PyrexScanner' object has no attribute 'level' >>> >>> Yes it does: >>> >>> """ >>> # Cython/Plex/Scanners.pxd >>> cdef class Scanner: >>> [...] >>> cdef public level >>> """ >>> >>> Try a clean build. >> >> Don't actually understand what's going wrong here? >> I'm running plain python cython, probably I'm wrong. > > These things usually happen to me when I use e.g. a compiled Scanners.so but > a plain Parsing.py. > This is actally cython bug PyrexScanner.level attribute is not initialized at module scope. Simple fix is to set level to 'other' or 'unknown' -- vitja. ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Bug report: lambda and numpy.vectorize segfaults
Vitja Makarov, 24.03.2011 19:15: 2011/3/24 Stefan Behnel: Vitja Makarov, 23.03.2011 20:11: 2011/3/23 Stefan Behnel: Vitja Makarov, 23.03.2011 17:25: File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", line 2307, in p_c_arg_decl if 'pxd' in s.level: AttributeError: 'PyrexScanner' object has no attribute 'level' Yes it does: """ # Cython/Plex/Scanners.pxd cdef class Scanner: [...] cdef public level """ Try a clean build. Don't actually understand what's going wrong here? I'm running plain python cython, probably I'm wrong. These things usually happen to me when I use e.g. a compiled Scanners.so but a plain Parsing.py. This is actally cython bug PyrexScanner.level attribute is not initialized at module scope. Ah, right, I actually appended the test code to the existing lambda tests, that's why the problem didn't show. Simple fix is to set level to 'other' or 'unknown' Rather 'module' or 'module_pxd', depending on the parsing context. Stefan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython
On Thu, Mar 24, 2011 at 10:42 AM, Stefan Behnel wrote: > Stefan Behnel, 22.03.2011 08:59: >> >> Robert Bradshaw, 22.03.2011 08:14: >>> >>> On Mon, Mar 21, 2011 at 11:10 PM, Stefan Behnel wrote: Reimplementing existing C modules in Cython might, however, be more interesting for python-dev, but also be a larger undertaking. So a GSoC might be worth running on that. >>> >>> I think that's a great idea. Would you be willing to mentor such a >>> project. >> >> As usual, I'm not sure I'll have the time, but if no-one else steps up, >> I'd >> consider it. > > Should we sign up with the PSF GSoC umbrella to officially propose this > project? > > https://spreadsheets.google.com/viewform?formkey=dHh3WFNGYzkyWWE0ZjM1eFFoUUVGWmc6MQ > > Do we have any other topics for the GSoC this year? We'd be just in time if > we discuss this at the workshop, although somewhat late already. The student > application deadline is from March 28 to April 8. > > http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2011/timeline There's always our enhancements page, but some of those are fairly advanced. I think this'd be a really good GSoC project, very modular, and doesn't require getting to know the internals of the compiler to start making a serious contribution (at least not right away, I'm sure bugs and optimizations will be submitted). I'm willing to (co?)-mentor. Stefan? Craig? With the three of us we could easily mentor at least one student, and perhaps two (if another really solid proposal/student comes up). Anyone else willing to mentor? I haven't pushed on GSoC much this year yet because no one's stepped up to mentor, but there's still ample time on our side. - Robert ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython
On Wed, Mar 23, 2011 at 12:45 AM, Stefan Behnel wrote: > Craig Citro, 23.03.2011 08:11: >>> >>> We have a clear 1.0 goal, being able to compile the full Python >>> language. We're not there yet, but very close. It may make sense at >>> that point to also clean up any cruft we don't want to continue >>> supporting forever. I agree, until that point, there's no way we would >>> be a Python development dependency. >> >> Are we aiming for 100% compatibility, or 99.9%? For instance, I seem to >> recall a few dark corners we aren't planning on covering I started a list at http://wiki.cython.org/Unsupported . I'd say we can be as compatible as Jython/IronPython is, and more than CPython is between minor versions. I would be happy with a short, well-justified list of differences. This will be clearer once the community (which we're a part of) defines what Python vs. implementation details means. > I think it's more like 98%. CPython, PyPy and friends consider the more > obscure features like frame access a core Python language feature, but I > don't see an interest in making that work in Cython. If someone wants to > write the code, fine, as long as it's switched off outside of a future > "strict compatibility mode". I've never seen this used in any code that I > would have wanted to compile with Cython, and even in Python code it's only > really used for more or less "clever hacks". > > >> maybe some details of traceback construction? > > What I would like to see here is simply a fallback of the frames that we > create for tracebacks to look for a .py file (or even .pyx/.pxi file) next > to the compiled .so file, so that they can print the source line for the > executed line in the .so. > > Apart from that, it boils down to the issue of frame construction. See > above. Keep in mind that CPython's own C code currently gives you no frames > at all, so Cython modules already have a serious advantage over what's there > today. > > >> (I want to say multiple inheritance, too, >> but I think that's only an issue for cdef classes, right?) > > Yes. That's how things work in CPython at the C level, and I'm fine with > that. We have multiple inheritance for normal classes, so that's covered. Any auto-cdeffing of classes would have to be done carefully. >> I think it would >> be good to have this written down -- in particular, it seems like there's >> some momentum right now for clearly delineating "Python language >> semantics" >> vs. "CPython implementation detail" in the python-devel community, so it >> might be a particularly good time to raise these questions. > > +1, a "where do we stand?" topic is planned for the workshop anyway. +1 - Robert ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython
Robert Bradshaw, 24.03.2011 20:18: On Thu, Mar 24, 2011 at 10:42 AM, Stefan Behnel wrote: Stefan Behnel, 22.03.2011 08:59: Robert Bradshaw, 22.03.2011 08:14: On Mon, Mar 21, 2011 at 11:10 PM, Stefan Behnel wrote: Reimplementing existing C modules in Cython might, however, be more interesting for python-dev, but also be a larger undertaking. So a GSoC might be worth running on that. I think that's a great idea. Would you be willing to mentor such a project. As usual, I'm not sure I'll have the time, but if no-one else steps up, I'd consider it. Should we sign up with the PSF GSoC umbrella to officially propose this project? https://spreadsheets.google.com/viewform?formkey=dHh3WFNGYzkyWWE0ZjM1eFFoUUVGWmc6MQ Do we have any other topics for the GSoC this year? We'd be just in time if we discuss this at the workshop, although somewhat late already. The student application deadline is from March 28 to April 8. http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2011/timeline There's always our enhancements page, but some of those are fairly advanced. I think this'd be a really good GSoC project, very modular, and doesn't require getting to know the internals of the compiler to start making a serious contribution (at least not right away, I'm sure bugs and optimizations will be submitted). Well, almost certainly bugs will be found, at least, and if we get a fix as well, I'd be the more happy. :) I'm willing to (co?)-mentor. Stefan? Craig? With the three of us we could easily mentor at least one student, and perhaps two (if another really solid proposal/student comes up). +1, splitting this will make it easier for everyone. And there will be support from the lists anyway. Anyone else willing to mentor? I haven't pushed on GSoC much this year yet because no one's stepped up to mentor, but there's still ample time on our side. Ok, want to sign up the Cython project then? What became of the Sage proposal, BTW? Will they give a compiled stdlib a try? Stefan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython
On Thu, Mar 24, 2011 at 12:58 PM, Stefan Behnel wrote: > Robert Bradshaw, 24.03.2011 20:18: >> >> On Thu, Mar 24, 2011 at 10:42 AM, Stefan Behnel wrote: >>> >>> Stefan Behnel, 22.03.2011 08:59: Robert Bradshaw, 22.03.2011 08:14: > > On Mon, Mar 21, 2011 at 11:10 PM, Stefan Behnel wrote: >> >> Reimplementing existing C modules in Cython might, however, be more >> interesting for python-dev, but also be a larger undertaking. So a >> GSoC >> might be worth running on that. > > I think that's a great idea. Would you be willing to mentor such a > project. As usual, I'm not sure I'll have the time, but if no-one else steps up, I'd consider it. >>> >>> Should we sign up with the PSF GSoC umbrella to officially propose this >>> project? >>> >>> >>> https://spreadsheets.google.com/viewform?formkey=dHh3WFNGYzkyWWE0ZjM1eFFoUUVGWmc6MQ >>> >>> Do we have any other topics for the GSoC this year? We'd be just in time >>> if >>> we discuss this at the workshop, although somewhat late already. The >>> student >>> application deadline is from March 28 to April 8. >>> >>> >>> http://socghop.appspot.com/document/show/gsoc_program/google/gsoc2011/timeline >> >> There's always our enhancements page, but some of those are fairly >> advanced. I think this'd be a really good GSoC project, very modular, >> and doesn't require getting to know the internals of the compiler to >> start making a serious contribution (at least not right away, I'm sure >> bugs and optimizations will be submitted). > > Well, almost certainly bugs will be found, at least, and if we get a fix as > well, I'd be the more happy. :) > > >> I'm willing to (co?)-mentor. Stefan? Craig? With the three of us we >> could easily mentor at least one student, and perhaps two (if another >> really solid proposal/student comes up). > > +1, splitting this will make it easier for everyone. And there will be > support from the lists anyway. > > >> Anyone else willing to >> mentor? I haven't pushed on GSoC much this year yet because no one's >> stepped up to mentor, but there's still ample time on our side. > > Ok, want to sign up the Cython project then? Well, I'm talking about under the Python foundation umbrella. > What became of the Sage proposal, BTW? Will they give a compiled stdlib a > try? I completely forgot to ask (too many other things on my mind). We have a fairly extensive test suite, so I think the thing to do would be to try it out and see if anything breaks (which will be a good confidence builder for both Cython and Sage). - Robert ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython
Robert Bradshaw, 24.03.2011 21:03: On Thu, Mar 24, 2011 at 12:58 PM, Stefan Behnel wrote: Robert Bradshaw, 24.03.2011 20:18: Anyone else willing to mentor? I haven't pushed on GSoC much this year yet because no one's stepped up to mentor, but there's still ample time on our side. Ok, want to sign up the Cython project then? Well, I'm talking about under the Python foundation umbrella. That's what I meant. https://spreadsheets.google.com/viewform?formkey=dHh3WFNGYzkyWWE0ZjM1eFFoUUVGWmc6MQ What became of the Sage proposal, BTW? Will they give a compiled stdlib a try? I completely forgot to ask (too many other things on my mind). We have a fairly extensive test suite, so I think the thing to do would be to try it out and see if anything breaks (which will be a good confidence builder for both Cython and Sage). Sure. I think the first step is to show results, then we can see who likes them good enough to take the risk. Stefan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel
Re: [Cython] Bug in cython-mode.el under GNU Emacs 23.2.1
On Wed, Mar 23, 2011 at 3:48 PM, Lisandro Dalcin wrote: > On 22 March 2011 02:21, Vitja Makarov wrote: >> 2011/3/22 Rafe Kettler : >>> I've just tried out cython-mode.el and I was a bit disappointed when it >>> didn't work right off the bat. >>> >>> I added the following to my .emacs: >>> >>> (setq load-path (cons "~/lib/emacs-plugins" load-path)) >>> (require 'cython-mode) >>> >>> this initially gave me the following error when I restarted emacs: >>> >>> Warning (initialization): An error occurred while loading >>> `/home/rafe/.emacs': >>> >>> File error: Cannot open load file, python-mode >>> >>> To ensure normal operation, you should investigate and remove the >>> cause of the error in your initialization file. Start Emacs with >>> the `--debug-init' option to view a complete error backtrace. >>> >>> So, seeing that python-mode wasn't around, I changed line 3 of >>> cython-mode.el from (require 'python-mode) to (require 'python) and >>> everything works now. >>> >>> I got this mode from Github this morning and it is the latest version (you >>> can see it at >>> https://github.com/cython/cython/blob/master/Tools/cython-mode.el). >>> >>> I'm not an emacs lisp expert, so I'm not sure if there's something I'm >>> missing here or if I somehow loaded the package correctly. Anyway, I thought >>> you guys should know that I had a problem with the file but managed to get a >>> fix. If my fix needs to be applied, I'll patch it on Github. >>> >>> This is GNU Emacs 23.2.1 x64 on Fedora 14, btw. >>> >>> Rafe >>> >> >> Emacs23 have native support for python, you can install python-mode package: >> >> $ sudo apt-get install python-mode >> >> Instead of requiring python it's better to try python-mode first then python: >> >> (when (not (require 'python-mode nil t)) >> (require 'python)) >> > > Should we push this fix? Makes sense to me. Rafe, can you push your changes and do a pull request? - Robert ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel