pcre, bifs, drivers and ports

Sean Hinde <>
Mon Jul 31 17:16:26 CEST 2006


Hi Ernie,

On 31 Jul 2006, at 14:12, Ernie Makris wrote:

> Hello Erlangers,
>
> One thing I wanted to start a discussion on is getting pcre style
> regexps in erlang. The question
> I pose to the list is: What would be the best way to integrate the  
> pcre
> library into erlang.
> The possible approaches I've seen so far are:
> - create a linked in driver
> - create a port program
> - create new bifs (I'd really like this)

Yes, that about covers it.

> My obvious concerns are:
> - How stable is the C pcre library for long running servers
> - Stability implies:
>     - Memory leaks
>     - SIGSEGVs

No idea, but..

>
> I would love the library calls in erlang to be bifs. Are there any
> external examples, aside from just looking at the source that
> demonstrate how to cleanly add a new bif?

If you add this feature by hacking the otp release and adding bifs  
you would create all the long term issues of having a patched OTP  
release.

You would unlikely to get adopters of any open source version you  
released for much the same reason.

OTOH it is not too hard to create a linked in driver that could  
alternatively be compiled as a port program. That way you give users  
a choice between speed of a driver (almost the same as a BIF), or  
fault isolation.

Sean






More information about the erlang-questions mailing list