From: tomas@fabula.de
Cc: guile-user@gnu.org
Subject: Re: Stupid module and pregexp questions
Date: Thu, 8 May 2003 13:47:37 +0200 [thread overview]
Message-ID: <20030508114736.GA1283@www> (raw)
In-Reply-To: <200305060928.CAA13979@morrowfield.regexps.com>
On Tue, May 06, 2003 at 02:28:21AM -0700, Tom Lord wrote:
[I promised to come back after having a look at pregexp]
> It's really foolish, performance-wise, to do _all_ of a regexp engine
> in scheme until you can scan a string through a dfa table at <20
> instructions per character. If some of the hard-core compilers are
> up to that, I'm impressed -- but I'm quite sure none of the
> interpreters are. The interpreters will be off by no less than 1,
> and I'd expect 2 or 3 orders of magnitude (powers of 10, here).
After having a look at pregexp (in a way it's impressive: it implements
a compiler/matcher for a massive, Perl-like regexp language in just over
29K of Scheme. And it's fairly readable, even for a Scheme novice like
me), here's the results:
- Yes, it is a classical backtracking implementation, Perl style.
- It's completely done in Scheme, moving around with string-ref.
- IMHO it doesn't stand a chance to compete, performance-wise with
carefully written matchers (of the backtracking type: of course
DFA ones are miles away, depending on input). Even with the best
Scheme compilers available (I'm ready to bet my plush penguin on
that ;-)
Still, as an educational tool, and as a display of Scheme's expressive
power, it's a jewel.
I don't think it was written with efficiency in mind -- rather with clarity.
Besides, it makes for a good proposal of how a regexp interface to Scheme[1]
might look like. And to me, this seems to be the most important thing
in this thread.
----------
[1] Of the backtracking type, that is.
Regards
-- tomas
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2003-05-08 11:47 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-23 13:37 Stupid module and pregexp questions MJ Ray
2003-04-23 14:56 ` Paul Jarc
2003-04-24 10:01 ` MJ Ray
2003-04-24 12:52 ` Andreas Rottmann
2003-04-24 13:15 ` MJ Ray
2003-04-24 13:36 ` Andreas Rottmann
2003-04-24 16:58 ` Marius Vollmer
2003-04-24 22:55 ` Andreas Rottmann
2003-04-24 17:58 ` MJ Ray
2003-04-28 16:06 ` Rob Browning
2003-04-28 16:44 ` MJ Ray
2003-04-28 17:03 ` Rob Browning
2003-04-28 17:51 ` MJ Ray
2003-04-28 18:18 ` Rob Browning
2003-04-28 18:07 ` Dr. Peter Ivanyi
2003-04-29 18:38 ` MJ Ray
2003-04-28 17:53 ` tomas
2003-04-28 17:12 ` Rob Browning
2003-04-28 17:55 ` MJ Ray
2003-04-29 8:12 ` Low level things in C or Scheme [was Stupid module and pregexp questions] tomas
2003-04-29 17:35 ` Thamer Al-Harbash
2003-04-29 19:34 ` Low level things in C or Scheme Mikael Djurfeldt
2003-04-29 20:24 ` Ken Anderson
2003-04-30 4:27 ` Low level things in C or Scheme [was Stupid module and pregexp questions] Robert Uhl
2003-04-30 13:27 ` Thamer Al-Harbash
2003-04-30 6:39 ` tomas
2003-04-29 0:45 ` Stupid module and pregexp questions Robert Uhl
2003-04-29 22:06 ` MJ Ray
2003-04-29 23:21 ` Tom Lord
2003-04-30 0:04 ` Ken Anderson
2003-04-30 6:48 ` tomas
2003-04-30 6:31 ` Tom Lord
2003-04-30 6:35 ` Tom Lord
2003-10-24 21:29 ` Thien-Thi Nguyen
2003-10-24 22:30 ` Tom Lord
2003-10-26 18:38 ` Thien-Thi Nguyen
2003-04-30 6:58 ` Thien-Thi Nguyen
2003-04-30 10:34 ` tomas
2003-04-30 17:11 ` Tom Lord
2003-05-06 9:50 ` tomas
2003-05-06 9:28 ` Tom Lord
2003-05-08 11:47 ` tomas [this message]
2003-10-24 21:45 ` Thien-Thi Nguyen
2003-10-24 22:37 ` Tom Lord
2003-10-26 18:47 ` Thien-Thi Nguyen
2003-10-27 10:48 ` tomas
2003-05-05 5:11 ` Rob Browning
2003-05-05 6:18 ` Tom Lord
2003-05-05 7:47 ` Rob Browning
2003-05-05 17:33 ` Tom Lord
2003-05-05 19:37 ` Rob Browning
2003-05-05 20:19 ` Tom Lord
2003-10-24 22:26 ` Thien-Thi Nguyen
2003-10-24 22:58 ` Tom Lord
2003-10-26 19:02 ` Thien-Thi Nguyen
2003-10-27 10:26 ` tomas
2003-10-27 14:19 ` Dale P. Smith
2003-10-27 14:54 ` rm
2003-10-28 0:57 ` Robert Marlow
2003-10-28 1:59 ` Tom Lord
2003-10-29 9:36 ` Harri Haataja
2003-10-28 2:05 ` lord
[not found] ` <lord@morrowfield.regexps.com>
2003-10-28 2:23 ` Thien-Thi Nguyen
2003-04-30 4:38 ` Robert Uhl
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030508114736.GA1283@www \
--to=tomas@fabula.de \
--cc=guile-user@gnu.org \
/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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).