Subject: [clisp-list] Re: Regexps w/clisp

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Wed Jul 14 03:25:55 2004

Hi,

Edi Weitz wrote:
>IIRC this thread started with a discussion of problems of the current
>approach (using a C library). These issues would be moot with a Lisp
>library. And, as I said, it'd be good for Lisp marketing-wise if it
>didn't have to rely on other programming languages to do the "real
>work."

I second that. People have been asking during years for Lisp libraries, not for FFI bindings. Look how people in cll these days enjoy Ltk instead of TK-bindings via some FFI.

>the results above already show that PCRE is usually faster than
>CL-PPCRE. My point was that a regex engine written in Lisp will be
>fast enough in almost all cases you can imagine and it's portable
>between different target platforms by definition.

Using CL-PPCRE is good in portable code especially since IIRC CL-PPCRE exhibits good performance on Lisp implementations that compile to native code.

Maybe you could make CL-PPCRE look better in comparison by taking advantage of the fact that the PCRE interface has to convert strings (to UTF8), while the Lisp-only CL-PPCRE does not. I.e. PCRE may become slower with longer inputs.

The regexp module becomes abysmally slow when passing large strings via the FFI (which the pcre module avoids, because it's not FFI).

BTW, I see in the code
http://cvs.sourceforge.net/viewcvs.py/clisp/clisp/modules/pcre/cpcre.c?rev=1.18&view=auto
      /* mark_fp_invalid() is not exported from clisp.h */
It should become exported. It's very practical for modules.

Regards,
	Jorg Hohle