<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 27, 2013 at 7:57 AM, Eli Bendersky <span dir="ltr"><<a href="mailto:eliben@gmail.com" target="_blank">eliben@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>
> I read the cffi docs once again and went through some of the examples. I<br>
> want to divide this to two topics.<br>
><br>
> One is what you call the "ABI" level. IMHO, it's hands down superior to<br>
> ctypes. Your readdir demo demonstrates this very nicely. I would definitely<br>
> want to see this in the stdlib as an alternative way to interface to C<br>
> shared objects & DLLs.<br>
><br>
> Two is what you call the "API" level, which is where my opinion becomes<br>
> mixed. Some things just don't feel right to me:<br>
><br>
> 1. Tying in a C compiler into the flow of a program. I'm not sure whether we<br>
> have precedents for it in the stdlib. Does this work on Windows where<br>
> libraries and DLLs are usually built with MSVC?<br>
><br>
<br>
</div>Yes. Precedent in the stdlib is really the C API. All the same rules<br>
apply (including build and ship a dll).<br></blockquote><div><br></div></div><div>So would you say that the main use of the API level is provide an alternative for writing C API code to interface to C libraries. IOW, it's in competition with Swig?<br>

</div></div></div></div></blockquote><div><br></div><div style>I'd hardly call it competition. The primary language I interface with is C++ and cffi appears not see that giant elephant in the room (it'd need to use clang for parsing if it were going to do that)...</div>

<div style><br></div><div style>The goal is good, but being C only isn't super exciting to me.</div><div style><br></div><div style>Would there be a goal of using cffi to replace C extension module code in the standard library with cffi based versions instead of hand written CPython C API code?</div>

<div style>If not, why not?  (and what does that say about its limitations or practical it is?)</div><div style><br></div><div style>-0.5 from me. My inclination is not to add this to the standard library. But even if it were to be added, it sounds like others are coming up with questions and reasons why it isn't yet ready (always the first important step to seriously considering inclusion).</div>

<div style><br></div><div style>-gps</div></div></div></div>