On Feb 16, 2010, at 1:05 PM, Lisandro Dalcin wrote:

> On 16 February 2010 17:35, Dag Sverre Seljebotn
> <[email protected]> wrote:
>> Chris Colbert wrote:
>>> Hey all,
>>>
>>> When coding for the scikits.image project, we are making extensive  
>>> use
>>> of Cython. It would be nice to have algorithms that work on multiple
>>> datatypes (numpy dtypes) without having to hand code everything. So,
>>> i've been toying around with how a simple templating syntax might  
>>> look.
>>>
>>> I've thrown this up on pastebin:
>>>
>>> http://pastebin.com/f1a49143d
>>>
>>> I would think (but really i have no idea) that this would be  
>>> possible to
>>> have Cython do during cythonization. But I could implement a  
>>> templating
>>> script that does it, just as proof of concept.
>>>
>>> What do you all think of that?
>>
>> I'm happy for any effort done in the area in general. But I'm kind of
>> lukewarm to actually having your proposal into Cython as it stands.  
>> In
>> my mind there's two seperate concepts.
>>
>> 1) String-based templating
>> 2) Proper language templates
>>
>> 2) has been discussed pretty much in the past and is something we  
>> really
>> want to have in Cython. However it is something closer to C++  
>> templates
>> or Java generics and would look quite different from the syntax you  
>> propose.
>>
>> Your syntax is good for string-based templating (which is what you  
>> seem
>> to propose), however for that I think it is just as well to use a  
>> proper
>> templating engine and not couple Cython into it at all. I.e. write  
>> the
>> files using e.g. proper Cheetah templates, then use a script to  
>> turn it
>> into pyx (i.e. what you propose, but without the prospect of  
>> building it
>> into Cython, and without (re)inventing yet another templating  
>> language).
>>
>
> I agree.

I'll second this as well. Using NumPy's templating sounds like a good  
option for you.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to