On Apr-03, Benjamin Goldberg wrote:
> 
> I've been looking over the rx.ops, and am amazed at how cool it is :)
> 
> I'm wondering, however -- was this based on something else?

I believe Brent cooked it up more or less from scratch. It also served
as the inspiration for a couple more attempts at a perl6 regex
compiler.

> That is, does there exist some utility which translates regexen into C
> (or assembly) code, similar to how we translate regexen into parrot
> code?

I've never used it, but PCRE looks like a very nice regex -> C compiler.

> I've been searching, but all I've seen are tools to compile regexen into
> tree-like data structures, and these structures are then interpreted.

My parrot/languages/regex compiler only does regex -> parrot, but the
parrot code is a "direct" implementation, not a tree interpreter. It
does not use the rx.ops instructions; it just uses regular pasm
instructions and data structures.

However, I'm not sure what state the currently committed version is
in. My local copy is much advanced, though mostly just in the area of
integration with the languages/perl6 compiler. (I haven't committed it
because it still doesn't pass Sean's old regex test suite in t/rx,
although even then it is more advanced than the current perl6 regex
implementation.)

More unfinished work: I have a detailed description of part of the
implementation written, although I never finished it off enough to
release. I'll put up my current draft version at
<http://0xdeadbeef.net/~sfink/uploads/regex.pod>.

> I wanna see a *real* regex compiler, which compiles down to C or native
> code. :)

Check out PCRE. Although a regex -> parrot -> JITted native code will
hopefully be nearly as fast. ;-)

Reply via email to