<div dir="ltr">On Mon, Nov 11, 2013 at 1:46 PM, Geoffrey Irving <span dir="ltr"><<a href="mailto:irving@naml.us" target="_blank">irving@naml.us</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm revamping Otherlab's use of petsc, and taking another look at<br>
petsc4py as part of that.  Previously we rolled our own Python<br>
bindings, but it'd be great to not have to do that.<br>
<br>
However, our usage would involve writing new C/C++ functions which<br>
take petsc types as arguments, and then exposing these new functions<br>
to python.  Is there a way to do this if the petsc4py bindings are<br>
written in Cython?</blockquote><div><br></div><div>1) Lisandro is the expert</div><div><br></div><div>2) C is fairly trivial using Cython</div><div><br></div><div>3) If you use a bunch of C++ stuff, at least when I evaluated things last time,</div>
<div>     Cython was fairly hard to manage (esp. templates). However, SWIG</div><div>     worked alright. I have never tried mixing SWIG and Cython, but I would</div><div>     think its possible, since all you have to do is pull out a wrapped pointer.</div>
<div><br></div><div>I have never seen mixed language programming be more efficient for a</div><div>developing library. Wrapping stable, debugged libraries makes a lot of sense,</div><div>and can really speed up development. Wrapping libraries you are still playing</div>
<div>with makes interfaces changes harder, and debugging a nightmare.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Geoffrey<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>