[Python-Dev] Re: About Pyrex

David Abrahams David Abrahams" <david.abrahams@rcn.com
Wed, 10 Apr 2002 01:00:09 -0500

----- Original Message -----
From: "Ralf W. Grosse-Kunstleve" <rwgk@cci.lbl.gov>

> The most important feature for me is that both the compiled code and
> the interpreted code look nice and are extensible.
> The second most important feature is that all you need is Python
> and C++. There is no third (little) language to learn (as with
> SWIG).

As libraries start to take more advantage of template metaprogramming
techniques, their interface starts to approach a language definition.
How different, really, is the following from being an IDL?

        .def("copy_Y", copy_Y,
        .def("copy_Z", copy_Z,
        .def("x_instances", &X::count)
            .def("value", &Y::value)
            .def("set", &Y::set)

            class_<Z,std::auto_ptr<Z> >("Z")
            .def("value", &Z::value)
            .def("set", &Z::set)

The real advantage to using the C++ compiler as opposed to intermediate
language is that we can be sure it is up to the job of dealing with any
C/C++ language constructs we throw at it.