I had started playing around with this when I was learning Rust, but got caught up in exams and didn't finish.
You can find my notes and some (probably non-functional) code here: https://github.com/mcpherrinm/rerust I was interested in using the thompson NFA construction so that LLVM could generate native code to match the regular expressions, hopefully reducing some of the overhead Patrick mentioned. On Sat, May 4, 2013 at 2:08 PM, Patrick Walton <[email protected]> wrote: > On 5/4/13 6:54 AM, Devin Jeanpierre wrote: > >> A point brought up in #rust: if we use RE2 or similar, we may not >> be able to have a re!() syntax extension that compiles regexps at >> the same time as the surrounding rust code. >> > > I like the re!() extension idea, just for performance reasons. If you look > at regexp-dna in the shootout, V8 is at the top, significantly ahead of C: > this is because it JITs regexes. Regex performance is important for Web > servers, because of routes. > > > RE2 has a good summary of regex syntax, although it doesn't >> specify for PCRE-family syntax whether it comes from perl, libpcre, >> python, or something else. >> > > Note that, as far as I'm aware, RE2 has pretty bad performance in general > (see Go's performance in regexp-dna). I'm actually personally somewhat > skeptical of the practical advantages of the Thompson NFA algorithm > compared to recursive backtracking: it makes pathological regexes much > faster, but at the cost of significant overhead for non-pathological > regexes (which are 99% of regexes used in reality). > > To me the hybrid approach is interesting: try recursive backtracking > first, and if it takes too long fall back to the Thompson NFA, to avoid the > DoS problem. > > Patrick > > > ______________________________**_________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev> >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
