|
|
Subscribe / Log in / New account

Re: [RFC] Adding Python as a possible language and it's usage

From:  Martin Liška <mliska-AT-suse.cz>
To:  Jeff Law <law-AT-redhat.com>, Segher Boessenkool <segher-AT-kernel.crashing.org>, Richard Biener <richard.guenther-AT-gmail.com>
Subject:  Re: [RFC] Adding Python as a possible language and it's usage
Date:  Fri, 20 Jul 2018 12:02:17 +0200
Message-ID:  <7e052468-ab3f-6d5c-0067-ff9e56abc712@suse.cz>
Cc:  GCC Development <gcc-AT-gcc.gnu.org>
Archive-link:  Article

On 07/19/2018 04:47 PM, Jeff Law wrote:
> On 07/18/2018 03:28 PM, Segher Boessenkool wrote:
>> On Wed, Jul 18, 2018 at 11:51:36AM +0200, Richard Biener wrote:
>>> We already conditionally require Perl for building for some targets so I wonder
>>> if using perl would be better ...
>>
>> At least perl is GPL (Python is not).
>>
>>
>> What would the advantage of using Python be?  I haven't heard any yet.
>> Awk may be a bit clunky but at least it is easily readable for anyone.
> I've found python *far* easier to read than awk.  And you can actually
> run a debugger on your python code to see what it's doing.
> Jeff
> 

Yes, using Python is mainly because of object-oriented programming paradigm.
It's handy to have encapsulation of functionality in methods, one can do
unit-testing of parts of the script. Currently AWK scripts are mix of input/output
transformation and various emission of printf('#error..') sanity checks.
In general the script is not easily readable and contains multiple global arrays
that simulate encapsulation in classes.

Martin




to post comments


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds