[Python-Dev] Proposing "Argument Clinic", a new way of specifying arguments to builtins for CPython

Nick Coghlan ncoghlan at gmail.com
Tue Dec 4 02:57:33 CET 2012


On Tue, Dec 4, 2012 at 8:37 AM, Barry Warsaw <barry at python.org> wrote:

> On Dec 03, 2012, at 02:29 PM, Larry Hastings wrote:
>
> >4) Builtin function arguments are defined in a small DSL; these
> >    are expanded to code and data using a custom compile-time
> >    preprocessor step.
> >
> >All the core devs I've asked said "given all that, I'd prefer the
> >hairy preprocessor macros".  But by the end of the conversation
> >they'd changed their minds to prefer the custom DSL.  Maybe I'll
> >make a believer out of you too--read on!
>
> The biggest question with generated code is always the effect on debugging.
> How horrible will it be when I have to step through argument parsing to
> figure
> out what's going wrong?
>

That's the advantage of the Cog-style approach that modifies the C source
files in place and records checksums so the generator can easily tell when
the code needs to be regenerated, either because it was changed via hand
editing or because the definition changed. Yes, it violates the guideline
of "don't check in generated code", but it makes debugging sane.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20121204/99a17831/attachment.html>


More information about the Python-Dev mailing list