Re: [Cython] Interest in contributing to the project

2011-04-01 Thread Stefan Behnel

Arthur de Souza Ribeiro, 29.03.2011 09:11:

Hello everybody,

My name is Arthur de Souza Ribeiro and I'm a fourth-year student of Computer
Science in Federal University of Campina Grande, Brazil. I'm a python
programmer and have knowledge of other languages too, like Java, C, C++, Qt,
Grails and ActionScript (used in Flex framework of Adobe).

I saw Cython project and got really interested in contributing to it. By the
way, I saw that the project is trying to participate of GSoC under Python
Software Foundation umbrella. I know the student application period have
already started, but, I'd really enjoy to participate of GSoC 2011 as a
Cython's student. Until day 8 I could work really hard to show you that I
can be selected as a GSoC student for Cython. I looked for an Ideas Page of
the project but didn't find it, Is there any idea that you have to submit a
project in GSoC?

If possible, please tell me things that I can start doing to help the
project.


Hi Arthur,

sorry for the late response and thank you for your application. We are 
always happy about contributions.


The Cython project is currently running a workshop that may yield further 
possible GSoC tasks, but the one we already have identified is IMHO quite a 
nice and self-contained one. The goal is to rewrite modules in CPython's 
standard library in Cython that are currently written in C. The intention 
is a) to simplify the implementation to make it easier for CPython 
developers to maintain their code base and b) to try to make the modules 
even faster than they are to show off Cython's optimisation capabilities 
(in that order, I think).


A related task could be to take existing Python modules in the stdlib, to 
profile them, and to add external type annotations to optimise them when 
being compiled with Cython.


Both the task of showing Cython's ability to efficiently (and compatibly) 
implement or compile parts of the stdlib, and the resulting testing of 
Cython (and bug reporting/fixing) against real world Python code would be 
very valuable to our project.


If you're interested, you could start by writing a short proposal including 
the modules that you would like to rewrite and what makes them interesting. 
Both "itertools" and "math" are certainly hot candidates, but there are 
definitely others, and your interest may change the priorities.


If you think that's not a good project for you, please bug us again, we may 
be able to come up with other projects as well.


Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] implementation of cdef functions with default arguments

2011-04-01 Thread Lisandro Dalcin
Perhaps I'm missing something, but why we need the intermediate
struct? Why not generate a regular C function with all the args, and
then generate the call providing arguments? We could even extend this
to support kwargs for calling functions in Cython,

1 - The implementation would be cleaner, IMHO.
2 - These functions cannot be easily used in external C code (or
course, C code should provide all the args)
3 - We could define default args for "cdef extern" C functions, Cython
would provide the arg values on call.
4 - We could add support to pass values as kwargs (well, we could do
that with the current implementation).
5 - Faster code?

Comments?

-- 
Lisandro Dalcin
---
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Interest in contributing to the project

2011-04-01 Thread Arthur de Souza Ribeiro
HI Stefan, thank you very much for responding my e-mail to cython's list.

About the proposal, I'd be very happy in helping the cython community doing
the task 'rewrite modules in CPython's standard library in Cython that are
currently written in C'. I didn't think about any special modules, but I'm
going to start doing it, in my opinion, both modules you've mentioned are
really good examples.

I think this project could be very important, but, I don't know CPython very
well, are there any examples you could suggest me to understand CPython
better? I think I could do a good effort to understand this as fast as I can
and we discuss more the proposal.

Waiting for your reply...

Best Regards..

[]s

Arthur

2011/4/1 Stefan Behnel 

> Arthur de Souza Ribeiro, 29.03.2011 09:11:
>
>  Hello everybody,
>>
>> My name is Arthur de Souza Ribeiro and I'm a fourth-year student of
>> Computer
>> Science in Federal University of Campina Grande, Brazil. I'm a python
>> programmer and have knowledge of other languages too, like Java, C, C++,
>> Qt,
>> Grails and ActionScript (used in Flex framework of Adobe).
>>
>> I saw Cython project and got really interested in contributing to it. By
>> the
>> way, I saw that the project is trying to participate of GSoC under Python
>> Software Foundation umbrella. I know the student application period have
>> already started, but, I'd really enjoy to participate of GSoC 2011 as a
>> Cython's student. Until day 8 I could work really hard to show you that I
>> can be selected as a GSoC student for Cython. I looked for an Ideas Page
>> of
>> the project but didn't find it, Is there any idea that you have to submit
>> a
>> project in GSoC?
>>
>> If possible, please tell me things that I can start doing to help the
>> project.
>>
>
> Hi Arthur,
>
> sorry for the late response and thank you for your application. We are
> always happy about contributions.
>
> The Cython project is currently running a workshop that may yield further
> possible GSoC tasks, but the one we already have identified is IMHO quite a
> nice and self-contained one. The goal is to rewrite modules in CPython's
> standard library in Cython that are currently written in C. The intention is
> a) to simplify the implementation to make it easier for CPython developers
> to maintain their code base and b) to try to make the modules even faster
> than they are to show off Cython's optimisation capabilities (in that order,
> I think).
>
> A related task could be to take existing Python modules in the stdlib, to
> profile them, and to add external type annotations to optimise them when
> being compiled with Cython.
>
> Both the task of showing Cython's ability to efficiently (and compatibly)
> implement or compile parts of the stdlib, and the resulting testing of
> Cython (and bug reporting/fixing) against real world Python code would be
> very valuable to our project.
>
> If you're interested, you could start by writing a short proposal including
> the modules that you would like to rewrite and what makes them interesting.
> Both "itertools" and "math" are certainly hot candidates, but there are
> definitely others, and your interest may change the priorities.
>
> If you think that's not a good project for you, please bug us again, we may
> be able to come up with other projects as well.
>
> Stefan
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Interest in contributing to the project

2011-04-01 Thread Stefan Behnel

Hi Arthur,

Arthur de Souza Ribeiro, 02.04.2011 03:52:

HI Stefan, thank you very much for responding my e-mail to cython's list.

About the proposal, I'd be very happy in helping the cython community doing
the task 'rewrite modules in CPython's standard library in Cython that are
currently written in C'. I didn't think about any special modules, but I'm
going to start doing it, in my opinion, both modules you've mentioned are
really good examples.


Cool.



I think this project could be very important, but, I don't know CPython very
well, are there any examples you could suggest me to understand CPython
better? I think I could do a good effort to understand this as fast as I can
and we discuss more the proposal.


The nice thing about this task is that you don't have to be an expert of 
CPython's C-API, nor a core developer of Cython. You will have to read the 
C code of the modules, and you will have to look up and understand what the 
C-API calls in the code are doing, but most of them have rather 
understandable names.


However, you will have to program efficiently in Cython, and write fast 
code in it. Writing Cython code that is easy to read and maintain, and at 
the same time fast enough to replace the existing manually tuned C code is 
the challenging bit here.


So my advice would be to get going in Cython programming (take a look 
through our tutorials), and to start reading the source code of a couple of 
CPython stdlib modules to get an idea of what you need to translate.


It would certainly help your application if you could reimplement one 
reasonably sized and self-contained function in a stdlib C module of your 
choice, and present that on the cython-users mailing list to get feedback. 
A couple of benchmark or profiling results comparing it to the original 
CPython function would round this up very nicely.


Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel