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.

Supporting /use cases/ in a pythonic way is IMHO much better than giving
users only the basic, c-ish tools and then stepping aside to leave them
alone with their use. You can potentially do a lot more with low-level
tools, but you will also have to go low-level to use them right. Cython is
not a low-level language.


> So that's why I propose focusing on just getting the very basic 
> interfacing of the languages done, and get it all supported instead of 
> just STL.

I think it's worth treating each operator separately (as you already seem
to have started). Some may fit the Cython language well, others will have
to be integrated in a way that doesn't break the language but keeps most of
the C++ power intact. Side effects are a clear sign for not simply mapping
them to a Python operator, for example.


> When it comes to ++/--, basic fact is that it can be used for whatever 
> purpose in C++. We are, after all, talking about the language which 
> overloads "<<" for being "output to stream" -- again, with *no* explicit 
> support for streams in the language; just by the usual operator overloading.

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.

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

Reply via email to