From: Edi Weitz
Subject: Announcement: CL-PPCRE
Date: 
Message-ID: <87smwt9bme.fsf@bird.agharta.de>
OK, you think that Lispers rarely, if ever, need regular expressions?
You think that there are already enough high-quality regex packages
for CL out there? You think that Perl ain't exactly a good role model
for syntax?  Well, there's no need to argue with me - I share your
opinions.

Nevertheless, the code that I'm going to announce here is the result
of a bet and as it now looks quite useful to me I though I could as
well publish it. So here we go:

CL-PPCRE is a portable regular expression library for Common Lisp
which has the following features:

    * It is compatible with Perl. It even correctly parses and applies
      Jeffrey Friedl's famous 6600-byte long RFC822 address pattern.

    * It is fast. If compiled with CMUCL it outperforms Perl's highly
      optimized regex engine (written in C) which to my knowledge is
      faster than most other regex engines around.

    * It is portable, i.e. the code aims to be strictly
      ANSI-compliant. It has been successfully tested with CMUCL,
      SBCL, SCL, CLISP, LW, ACL, MCL, and OpenMCL on various operating
      systems.

    * It is thread-safe.

    * It comes with convenient features like a SPLIT function, a
      couple of DO-like loop constructs, and a regex-based APROPOS
      feature similar to the one found in Emacs.

    * In addition to specifying regular expressions as strings like in
      Perl you can also use S-expressions which obviously is more
      Lisp-y.

    * Is it is fully documented so I might have a chance to understand
      my own code in about six months... :)

    * It comes with a BSD-style license so you can basically do with
      it whatever you want.

More details and the code itself can be found at

    <http://weitz.de/cl-ppcre/>

Please send bug reports, critique, or patches to <···@agharta.de>.

From: Alan Walker
Subject: Re: Announcement: CL-PPCRE
Date: 
Message-ID: <v07ch3oi8kp063@corp.supernews.com>
What was the bet?

Alan.


"Edi Weitz" <···@agharta.de> wrote in message
···················@bird.agharta.de...
> OK, you think that Lispers rarely, if ever, need regular expressions?
> You think that there are already enough high-quality regex packages
> for CL out there? You think that Perl ain't exactly a good role model
> for syntax?  Well, there's no need to argue with me - I share your
> opinions.
>
> Nevertheless, the code that I'm going to announce here is the result
> of a bet and as it now looks quite useful to me I though I could as
> well publish it. So here we go:
>
> CL-PPCRE is a portable regular expression library for Common Lisp
> which has the following features:
>
>     * It is compatible with Perl. It even correctly parses and applies
>       Jeffrey Friedl's famous 6600-byte long RFC822 address pattern.
>
>     * It is fast. If compiled with CMUCL it outperforms Perl's highly
>       optimized regex engine (written in C) which to my knowledge is
>       faster than most other regex engines around.
>
>     * It is portable, i.e. the code aims to be strictly
>       ANSI-compliant. It has been successfully tested with CMUCL,
>       SBCL, SCL, CLISP, LW, ACL, MCL, and OpenMCL on various operating
>       systems.
>
>     * It is thread-safe.
>
>     * It comes with convenient features like a SPLIT function, a
>       couple of DO-like loop constructs, and a regex-based APROPOS
>       feature similar to the one found in Emacs.
>
>     * In addition to specifying regular expressions as strings like in
>       Perl you can also use S-expressions which obviously is more
>       Lisp-y.
>
>     * Is it is fully documented so I might have a chance to understand
>       my own code in about six months... :)
>
>     * It comes with a BSD-style license so you can basically do with
>       it whatever you want.
>
> More details and the code itself can be found at
>
>     <http://weitz.de/cl-ppcre/>
>
> Please send bug reports, critique, or patches to <···@agharta.de>.
From: Edi Weitz
Subject: Re: Announcement: CL-PPCRE
Date: 
Message-ID: <87ptrwky7g.fsf@bird.agharta.de>
"Alan Walker" <·························@charter.net> writes:

> What was the bet?

That is was possible to write a regex parser in CL that is compatible
with Perl and at least as fast. You know, the usual stuff that starts
with "But isn't Lisp slow, old and only used for AI research?"...

I admit I got carried away a bit. The most difficult part was to write
a parser to grok Perl's regex syntax and if you look at my code it
shows.

Now, CL-PPCRE isn't 100% Perl-compatible (which I claim no program can
be, not even Perl[1]) and there are a few cases where Perl is faster
than CMUCL/CL-PPCRE but we agreed that I had won... :)

Cheers,
Edi.

[1] See for example the first three cases in

      <http://weitz.de/cl-ppcre/#perl>.
From: Alan Walker
Subject: Re: Announcement: CL-PPCRE
Date: 
Message-ID: <v07m6l931vqu67@corp.supernews.com>
Edi,

Excellent results and congrats on winning your bet.  I may use your example
at work to explain to people why Lisp isn't slow.  I enjoy programming in
Lisp, but that shouldn't surprise people in this newsgroup.  I'm probably
more proficient in C++, 'cause that's what we have to use at work, but I
always feel like I'm fighting the compiler the whole way.  Despite that, I
can develop and test new algorithms faster in Lisp.

What did you win?  Something more than bragging rights?

Alan.


"Edi Weitz" <···@agharta.de> wrote in message
···················@bird.agharta.de...
> "Alan Walker" <·························@charter.net> writes:
>
> > What was the bet?
>
> That is was possible to write a regex parser in CL that is compatible
> with Perl and at least as fast. You know, the usual stuff that starts
> with "But isn't Lisp slow, old and only used for AI research?"...
>
> I admit I got carried away a bit. The most difficult part was to write
> a parser to grok Perl's regex syntax and if you look at my code it
> shows.
>
> Now, CL-PPCRE isn't 100% Perl-compatible (which I claim no program can
> be, not even Perl[1]) and there are a few cases where Perl is faster
> than CMUCL/CL-PPCRE but we agreed that I had won... :)
>
> Cheers,
> Edi.
>
> [1] See for example the first three cases in
>
>       <http://weitz.de/cl-ppcre/#perl>.
From: Edi Weitz
Subject: Re: Announcement: CL-PPCRE
Date: 
Message-ID: <87znqzvge4.fsf@bird.agharta.de>
"Alan Walker" <·························@charter.net> writes:

> I may use your example at work to explain to people why Lisp isn't
> slow.

Feel free to do so. But you know that there are much more examples
like that around. See for example Pierre R. Mai's MD5 implementation,
some of the "add-a-gram" solutions that were posted to this newsgroup,
or some of the stuff from the "programming language shoot-out".

> What did you win?  Something more than bragging rights?

Unfortunately not... :)

Cheers,
Edi.
From: Nils Goesche
Subject: Re: Announcement: CL-PPCRE
Date: 
Message-ID: <8765toiok1.fsf@darkstar.cartan>
Edi Weitz <···@agharta.de> writes:

> Nevertheless, the code that I'm going to announce here is the
> result of a bet...
> 
> CL-PPCRE is a portable regular expression library for Common
> Lisp which has the following features:

Got a clean compile (LWL) and everything seems to work fine.
Very cool, thanks for this!

Did you win the bet? :-)

Regards,
-- 
Nils G�sche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID #xD26EF2A0
From: Edi Weitz
Subject: Re: Announcement: CL-PPCRE
Date: 
Message-ID: <87isxo8sco.fsf@bird.agharta.de>
Nils Goesche <···@cartan.de> writes:

> Got a clean compile (LWL) and everything seems to work fine.  Very
> cool, thanks for this!
> 
> Did you win the bet? :-)

Yes... :)