News for hackers. Stuff that matters.
Re:Regex Engine Internals as a Library by burntsushi on Wednesday July 05, 2023 @10:47AM (#36601176)
These sound like two different things. PCRE2, for example, has support for "callouts" which sound similar to what you're saying? https://www.pcre.org/current/doc/html/pcre2callout.html --- Other things like ragel and re2c have done similar things.

What I'm talking about in this blog is very different from that. This is about taking the internals of the regex library itself and turning them in a separately versioned library that others can compose.

This makes somewhat less sense for a backtracker because most backtrackers just have one engine: the backtracker. But an automata based library usually has many different engines that can be composed in different ways. Still, backtrackers have things they could expose but don't in practice, such as a regex parser and an AST.

Re:Regex Engine Internals as a Library by nsajko on Wednesday July 05, 2023 @11:47AM (#36602104)
You're both correct. In the context of Julia, where compilation and run time are arbitrarily interleaved, something like re2c can be a library and used at run time.
Re:Regex Engine Internals as a Library by burntsushi on Thursday July 06, 2023 @07:37AM (#36614308)
Just to be clear here, I mentioned re2c as an example of what my blog is not about. There is a category difference between "ask a regex engine to run arbitrary code" and "expose internals as a separately versioned library for others to compose as they want." They service different use cases.