Robert Bradshaw wrote:
>> 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.

Good observation. I now believe strongly that it has merits though: It 
allows one to skip the whole issue by keeping Cython semantics in Cython 
and C++ semantics in C++.

I'm sure noone asked for it, but even so here's my draft on how I'd like 
to see C++ support.

http://wiki.cython.org/enhancements/inlinecpp

Note:
  a) It has many uses outside of C++ wrapping as well
  b) It is probably easier to implement than anything else we could come 
up with (not that that is a deciding factor)
  c) By its hacky nature, it gives full support at once rather than 
covering case-by-case

Think about being the author of a C++ library wanting to wrap it in 
Cython -- would this be so bad?

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

Reply via email to