From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: haj@posteo.de (Harald =?utf-8?Q?J=C3=B6rg?=) Newsgroups: gmane.emacs.help Subject: Re: For text processing, which is more powerful, emacs or perl? Date: Sat, 19 Dec 2020 15:36:52 +0100 Message-ID: <87zh29ooaj.fsf@hajtower> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22276"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs , Jean Louis To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 19 15:37:39 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqdMZ-0005i2-M5 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 15:37:39 +0100 Original-Received: from localhost ([::1]:51982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqdMY-0005PN-OC for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 09:37:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqdLy-0005PD-VM for help-gnu-emacs@gnu.org; Sat, 19 Dec 2020 09:37:03 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:42820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqdLt-0004gi-NL for help-gnu-emacs@gnu.org; Sat, 19 Dec 2020 09:37:02 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 0996016005C for ; Sat, 19 Dec 2020 15:36:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1608388614; bh=jSa/7Q2TZHRV7dnGr03ZIe2vLCSnjoY+W3cbqPZwCq4=; h=From:To:Cc:Subject:Date:From; b=kYWs6w2QdtjKe9mB65BbdXOoCNmwh8KzjFmGRdUEnCud1YhgMbVBWm6LGXSkXKGvk RxlB7/BxXLgxGSGnec50mHkibEhJI+U2eJ2vRBe2rPI33RoqDOl3d3f1LZmvUU1nad cTvec7CqybLIWSaZVx1pjdPckMHZWmQ07lNB295tGGEGSveqk3V+qHcqAr/qj5+wSi lOT359/9fLS0Z+BkaL/NWLN88i8z/a4Ng8Ph6s8F5FvT1Hp+7bA7iOE3dLmbgj7ck1 KL7/Ddn2uNQ5Ydfxr3rYJBRHd/L/0/nQf6fvRNsQ9H3X0P9OPfVwX4Ztz2IaUo++iH kjseri/ghPLDA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4CypGF12Hpz9rxM; Sat, 19 Dec 2020 15:36:52 +0100 (CET) In-Reply-To: (Hongyi Zhao's message of "Sat, 19 Dec 2020 20:17:49 +0800") Received-SPF: pass client-ip=185.67.36.65; envelope-from=haj@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126572 Archived-At: Hongyi Zhao writes: > On Sat, Dec 19, 2020 at 5:16 PM Jean Louis wrote: >> >> * Hongyi Zhao [2020-12-19 10:44]: >> > It's well known that perl's regexp is very powerful for its capability >> > of text processing. So, which is more powerful, emacs or perl, in this >> > scenario? >> >> Well it is better to tell what you wish to achieve. What kind of text >> do you wish to process? >> >> I was doing many command line processing with Perl, importing data >> with Perl, processing text, importing into databases, processing large >> programs. It is more for command line processing and programmatic >> processing. >> >> Today I do those things with Emacs Lisp so I import CSV data, process >> entries, insert into databases. I do not miss Perl today. Emacs Lisp >> seem to me simpler now than Perl back then. Regarding regular expressions, Perl is still ahead of Emacs: It has zero-with assertions (sort of 'looking-at' within a regexp), "possessive" matches which help avoiding exponential backtracking times, named captures to make long regexps more readable, and more. That also underlines your point: This excels for programmatic processing, it is not that important for interactive use. > [... snip ...} > > 1. What about use emacs as an IDE to debug perl code? M-x perldb and off you go! The advantages in comparison to debugging on the terminal are that Emacs shows the source code while you're debugging, and it has a practically unlimited output buffer, so you can dump large structures. And then, you can use Emacs' capabilities to search and navigate through the output. That's not specific to Perl, of course. > 2. Nowadays, it seems that many packages on cpan cannot be updated in > time like those packages on pypi for python, so I think whether this > means that Perl is obsolete. I don't understand that statement: https://metacpan.org/recent shows some dozens updates per day. Perl itself regularly gets a new version each year. For Emacs as an editor, the (inofficial) survey https://emacssurvey.org/2020/ has a slide titled "If you use Emacs for programming, which languages do you program in"?. This gives some evidence: Python is more popular, but Perl isn't obsolete. -- Cheers, haj