<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 26, 2013 at 11:29 PM, Ronald Oussoren <span dir="ltr"><<a href="mailto:ronaldoussoren@mac.com" target="_blank">ronaldoussoren@mac.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im"><br>
On 26 Feb, 2013, at 16:13, Maciej Fijalkowski <<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>> wrote:<br>
<br>
> Hello.<br>
><br>
> I would like to discuss on the language summit a potential inclusion<br>
> of cffi[1] into stdlib.<br>
<br>
</div>The API in general looks nice, but I do have some concens w.r.t. including cffi in the stdlib.<br>
<br>
1. Why is cffi completely separate from ctypes, instead of layered on top of it? That is, add a utility module to ctypes that can parse C declarations and generate the right ctypes definitions.<br>
<br>
2. Cffi has a dependencies on pycparser and that module and its dependencies would therefore also be added to the stdlib (even if they'd be hidden in the cffi package)<br>
<br>
3. Cffi basicly contains a (limited) C parser, and those are notoriously hard to get exactly right. Luckily cffi only needs to interpret declarations and not the full language, but even so this can be a risk of subtle bugs.<br>

</blockquote><br></div>pycparser has been around for more than 4 years and is pretty stable. I know that it's been used to parse Windows headers, Linux system headers and other "scary" things for a C parser to handle. It's only known problem has to do with over-creative abuses of C's context sensitivity: <br>

</div><div class="gmail_extra"><a href="http://eli.thegreenplace.net/2011/05/02/the-context-sensitivity-of-c%E2%80%99s-grammar-revisited/">http://eli.thegreenplace.net/2011/05/02/the-context-sensitivity-of-c%E2%80%99s-grammar-revisited/</a><br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra">In practice it doesn't come up often, and almost never in declarations, which is the subset cffi uses pycparser for. <br></div><div class="gmail_extra">

<br></div><div class="gmail_extra">Eli<br></div><div class="gmail_extra"><br><br></div></div>