Generate all Argument Clinic code into separate files
Currently for some files converted to use Argument Clinic the generated code is written into a separate file, for other files it is inlined. I'm going to make a number of small enhancement to Argument Clinic to generate faster code for parsing arguments (see for example issue23492). Every such step will produce large diffs for generated code and will create code churn if it is inlined and mixed up with handwritten code. It would be better when only generated files will be changed. So I suggest to move all inlined generated code in separate file. What are you think?
On Sat Feb 21 2015 at 1:50:32 PM Serhiy Storchaka <storchaka@gmail.com> wrote:
Currently for some files converted to use Argument Clinic the generated code is written into a separate file, for other files it is inlined.
I'm going to make a number of small enhancement to Argument Clinic to generate faster code for parsing arguments (see for example issue23492). Every such step will produce large diffs for generated code and will create code churn if it is inlined and mixed up with handwritten code. It would be better when only generated files will be changed. So I suggest to move all inlined generated code in separate file. What are you think?
+1 to moving to a separate file for all .c files. Might be painful now but the long-terms benefits are worth it.
On 22 February 2015 at 06:58, Brett Cannon <brett@python.org> wrote:
On Sat Feb 21 2015 at 1:50:32 PM Serhiy Storchaka <storchaka@gmail.com> wrote:
Currently for some files converted to use Argument Clinic the generated code is written into a separate file, for other files it is inlined.
I'm going to make a number of small enhancement to Argument Clinic to generate faster code for parsing arguments (see for example issue23492). Every such step will produce large diffs for generated code and will create code churn if it is inlined and mixed up with handwritten code. It would be better when only generated files will be changed. So I suggest to move all inlined generated code in separate file. What are you think?
+1 to moving to a separate file for all .c files. Might be painful now but the long-terms benefits are worth it.
Yeah, agreed. Originally I was a fan of having everything inline so I could see them while I was working on the code, but I eventually changed my mind to favour making it a clearer build step with a separate generated file. I suspect it was a matter of starting to trust AC to do the right thing, so having it implicitly asking me to check its work all the time ultimately become annoying rather than reassuring :) I assume some parts, like the header for the implementation function, will always need to be generated inline in the hand-edited implementation file, though. Regards, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
On 22.02.15 05:03, Nick Coghlan wrote:
On 22 February 2015 at 06:58, Brett Cannon <brett@python.org> wrote:
+1 to moving to a separate file for all .c files. Might be painful now but the long-terms benefits are worth it.
Yeah, agreed. Originally I was a fan of having everything inline so I could see them while I was working on the code, but I eventually changed my mind to favour making it a clearer build step with a separate generated file. I suspect it was a matter of starting to trust AC to do the right thing, so having it implicitly asking me to check its work all the time ultimately become annoying rather than reassuring :)
OK. Opened an issue: https://bugs.python.org/issue23501
participants (3)
-
Brett Cannon
-
Nick Coghlan
-
Serhiy Storchaka