From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15467 invoked by alias); 20 Jul 2018 10:02:22 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 15096 invoked by uid 89); 20 Jul 2018 10:02:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jul 2018 10:02:20 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BE155AD09; Fri, 20 Jul 2018 10:02:17 +0000 (UTC) Subject: Re: [RFC] Adding Python as a possible language and it's usage To: Jeff Law , Segher Boessenkool , Richard Biener Cc: GCC Development References: <20180718212839.GW16221@gate.crashing.org> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <7e052468-ab3f-6d5c-0067-ff9e56abc712@suse.cz> Date: Fri, 20 Jul 2018 10:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00293.txt.bz2 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