[Cython] RFC: an inline_ function that dumps c/c++ code to the code emitter

Kevin Thornton krthornt at uci.edu
Fri Aug 19 12:34:57 EDT 2016


Hi Robert,

Related to this point, I think there are three important features that
Cython would benefit from, as far as C++11 and newer are concerned.  In
order of what I'm guessing to be increased complexity are:

1. Non-type template parameters.
2. "rvalue" references for standalone functions and class member functions:

    void foo[T]( T && t )

3. Variadic templates (member and non-member).  More generally, "parameter
packs":

    http://en.cppreference.com/w/cpp/language/parameter_pack

#2 is important for efficiency reasons--it isn't just a convenience
feature.  Without it, Cython cannot support all the member function of
std::vector, etc.  The implication is that some expensive operations, like
moving a big object into a vector, require extra copies in Cython while a
C++ program would just move the object into the new location.

#3 seems like the hardest, but would enable std::tuple, std::bind, and
other handy things to be used in a .pyx file.

Support for "auto" would be nice, but perhaps unrealistic.

I know that PRs have been submitted, and since stalled out, on a couple of
these features.  I've tried to look at the Cython parser myself, but I'm
not able to follow it, sadly.

Thanks for all your hard work,

Kevin

On Fri, Aug 19, 2016 at 2:39 AM Robert Bradshaw <robertwb at gmail.com> wrote:

>
> Though, as you discovered, there are some basic things like non-type
> template arguments that we would like to have. If there are other
> specific C++ constructs that are commonly used but impossible to
> express in Cython it'd be useful to know.
>
>
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> https://mail.python.org/mailman/listinfo/cython-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20160819/b47d745b/attachment.html>


More information about the cython-devel mailing list