On Apr 26, 2009, at 12:27 PM, Dag Sverre Seljebotn wrote:

> Stefan Behnel wrote:
>> Hi Dag,
>>
>> given that I'm really far from a C++ expert, I'll try to keep my  
>> comments
>> at a meta-level.
>>
>> Dag Sverre Seljebotn wrote:
>>> Ahh; the missing piece: Iterators are nothing special in C++.  
>>> There's
>>> absolutely *no* concept of an iterator in the language. It's just  
>>> a set
>>> of conventions.
>>
>> Ah, thanks, didn't know that. But that doesn't mean they don't  
>> exist. It's
>> perfectly ok to support only the common conventions, and if users  
>> need
>> more, help them getting there, but without impacting the language  
>> itself.
>
> I'd love to write "for item in some_cpp_col" eventually, I just think
> the basics should be considered first.
>
>> I don't feel a need to hold the gun when users shoot their own  
>> foot. If
>> they want to, the language should try not to get in their way (in  
>> the worst
>> case, you can always go and define a header file with wild  
>> macros), but it
>> should not lead them there, either.
>>
>> There is no use in /integrating/ C++ into Cython. I think the idea  
>> is more
>> to make the sane parts of C++ easy to use and interface with. Side  
>> effects
>> on arbitrary operators that are visible from Cython code do not  
>> fall into
>> that category, IMHO. After all, you will read the Cython code and  
>> expect it
>> to make sense, even if you do not know that there is some wild C++  
>> operator
>> overloading trickery going on in the background.
>
> Thanks for summing up my sentiments so nicely :-) We agree here.

+1 from me too.

> My current stance is therefore that  I think we should *not* try to  
> make
> sense of what C++ declarations would mean in Cython, but rather  
> make it
> easy to write Cythonic wrappers for C++ code.
>
> But then you need to be able to call the operators in C++ somehow, to
> create the wrapper, as there often is no other way of calling them.  
> The
> problem is that C++ is so powerful and people do use that power.
>
> So my/current thoughts (though Robert and Danilo are calling the  
> shots)
> is along the lines of allowing inline C++ code. The declared interface
> must be Cythonic, but you can use C++ in the bridge in the C++.  
> Ugly but
> effective.

My first impression is that this is basically a more structured  
version of the string-substitution way of wrapping C++ that we are  
trying to get away from.

- Robert

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

Reply via email to