all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: haj@posteo.de (Harald Jörg)
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>, Jean Louis <bugs@gnu.support>
Subject: Re: For text processing, which is more powerful, emacs or perl?
Date: Sat, 19 Dec 2020 15:36:52 +0100	[thread overview]
Message-ID: <87zh29ooaj.fsf@hajtower> (raw)
In-Reply-To: <CAGP6POL_ekZ5VP8=nuFYBiF24joTSciO-Gxo7f9Dg0mU8MbK8Q@mail.gmail.com> (Hongyi Zhao's message of "Sat, 19 Dec 2020 20:17:49 +0800")

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> On Sat, Dec 19, 2020 at 5:16 PM Jean Louis <bugs@gnu.support> wrote:
>>
>> * Hongyi Zhao <hongyi.zhao@gmail.com> [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



  parent reply	other threads:[~2020-12-19 14:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-19  7:43 For text processing, which is more powerful, emacs or perl? Hongyi Zhao
2020-12-19  9:00 ` Jean Louis
2020-12-19 12:17   ` Hongyi Zhao
2020-12-19 12:25     ` Jean Louis
2020-12-20  0:04       ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-20  1:42         ` Hongyi Zhao
2020-12-20  3:07           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-20  5:31           ` Jean Louis
2020-12-20  6:18             ` Hongyi Zhao
2020-12-20  6:52               ` Jean Louis
2020-12-20  7:49                 ` Hongyi Zhao
2020-12-20 13:42                   ` Jean Louis
2020-12-20  3:03         ` Hongyi Zhao
2020-12-20  3:11           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-08 16:42       ` Marcin Borkowski
2020-12-19 14:36     ` Harald Jörg [this message]
2020-12-20  4:38       ` Jean Louis
2020-12-19 16:01 ` Stefan Monnier
2020-12-20  5:23   ` Jean Louis
2020-12-20  6:17     ` Hongyi Zhao
2020-12-20  6:25       ` Jean Louis
2020-12-20 13:58     ` Stefan Monnier
2020-12-20 14:47       ` tomas
2020-12-20  9:01   ` tomas
2021-10-08 16:52 ` Marcin Borkowski
2021-10-09  1:42   ` Hongyi Zhao
2021-10-10 14:26     ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh29ooaj.fsf@hajtower \
    --to=haj@posteo.de \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.