mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: embedded newbies site.
Date: Tue, 16 Jul 2013 10:00:53 -0400	[thread overview]
Message-ID: <20130716140053.GO29800@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAFipMOH5Tz09SVBqz1sd=VRXpMu7gNUL+9gmLiB43z7cV9LjYg@mail.gmail.com>

On Tue, Jul 16, 2013 at 07:50:29AM -0400, LM wrote:
> design.  For instance, there are some negative mentions about the PCRE
> library, but when I tried to track down the cons for using it, I only found
> dated performance comparisons showing how poorly it worked if you don't use
> the newer JIT implementation.  What might be a positive for a system that's

The whole concept of regular expressions is that they're regular,
meaning they're matchable in O(n) time with O(1) space. PCRE (the
implementation) uses backtracking for everything, giving it
exponentially-bad performance (JIT cannot fix this), and PCRE (the
language) has a lot of features that are fundamentally not regular and
thus can't be implemented efficiently. Also, the behavior of some of
the features (e.g. greedy vs non-greedy matching) were not designed
intentionally but just arose out of the backtracking implementation,
and thus don't make a lot of sense unless you think from the
standpoint of such an implementation.

Aside from performance, PCRE is harmful to CS education because it
undermines the whole definition of "regular" when students learn a
sense of "regular expression" that's not actually regular. Of course
this can be worked around if the instructor teaches this issue well
when teaching PCRE, but I think normally PCRE is just taught as a tool
without any theoretical background.

Rich


  parent reply	other threads:[~2013-07-16 14:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  2:03 Rob Landley
2013-07-16  3:18 ` Strake
2013-07-17 12:07   ` LM
2013-07-17 13:58     ` Rich Felker
2013-07-20 15:17   ` James B
2013-07-22 12:27     ` Andrew Bradford
2013-07-22  4:40   ` Rob Landley
2013-07-23  0:12     ` Strake
2013-07-27  0:58       ` Rob Landley
2013-07-27  2:01         ` Strake
2013-07-27  2:50           ` Rich Felker
2013-07-29 20:01             ` Rob Landley
2013-07-29 19:54           ` Rob Landley
2013-07-30  1:35             ` Strake
2013-08-01  6:20               ` Rob Landley
2013-08-03 16:52                 ` Strake
2013-07-16 11:50 ` LM
2013-07-16 13:56   ` Szabolcs Nagy
2013-07-16 14:00   ` Rich Felker [this message]
2013-07-16 17:49   ` Strake
2013-07-22  6:00   ` Rob Landley

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=20130716140053.GO29800@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.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 public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).