[Pyrex] Fwd: pyrex versus swig versus boost

William Stein wstein at gmail.com
Mon Sep 3 04:55:21 CEST 2007


On 9/2/07, David McNab <david at rebirthing.co.nz> wrote:
> Hi,
>
> Does anyone know of any comparisons between pyrex, swig, boost and the
> other wrapper-helpers?
>
> Especially, some insights on which situations favour which wrapping
> approach?

I wrote something a few months ago about this for the SAGE programming
guide, about why Pyrex is by far the best choice *for us* as compared to
the other options.  See section 5.1.2 of the programming guide here:

  http://sagemath.org/doc/html/prog/prog.html

I think SWIG, boost, and Pyrex all have their optimal domains of application.
E.g., SWIG is better if you want to expose an existing library to more
than just Python.   Pyrex is the best when raw speed is absolutely critical,
but working directly in C (against the Python/C API) is too time consuming
and bug prone given the size of the project.

 -- William


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.org



More information about the Pyrex mailing list