From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: tomas@fabula.de Newsgroups: gmane.lisp.guile.user Subject: Re: Stupid module and pregexp questions Date: Thu, 8 May 2003 13:47:37 +0200 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20030508114736.GA1283@www> References: <877k9eobcv.fsf@raven.i.defaultvalue.org> <20030430064840.GC22895@www> <20030430103445.GB23809@www> <20030506095052.GB23667@www> <200305060928.CAA13979@morrowfield.regexps.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052392021 19345 80.91.224.249 (8 May 2003 11:07:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 8 May 2003 11:07:01 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu May 08 13:06:51 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19DjEg-00051I-00 for ; Thu, 08 May 2003 13:06:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19Dixb-0003aR-06 for guile-user@m.gmane.org; Thu, 08 May 2003 06:49:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19Dix0-0003a5-00 for guile-user@gnu.org; Thu, 08 May 2003 06:48:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19Diwy-0003Zd-00 for guile-user@gnu.org; Thu, 08 May 2003 06:48:33 -0400 Original-Received: from [217.22.192.104] (helo=www.elogos.de) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19Diwx-0003ZW-00 for guile-user@gnu.org; Thu, 08 May 2003 06:48:32 -0400 Original-Received: by www.elogos.de (Postfix, from userid 5002) id 36A841457F; Thu, 8 May 2003 13:47:37 +0200 (CEST) Original-To: Tom Lord Content-Disposition: inline In-Reply-To: <200305060928.CAA13979@morrowfield.regexps.com> User-Agent: Mutt/1.5.3i X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1916 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1916 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