help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: For text processing, which is more powerful, emacs or perl?


From: Harald Jörg
Subject: Re: For text processing, which is more powerful, emacs or perl?
Date: Sat, 19 Dec 2020 15:36:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]