News for hackers. Stuff that matters.
Re:ECMAScript regular expressions are getting better (2017) by eridius on Wednesday November 28, 2018 @02:13PM (#18554642)
I was under the impression that Go's regex library was RE2. Wasn't RE2 originally written by Russ Cox?
Re:ECMAScript regular expressions are getting better (2017) by burntsushi on Wednesday November 28, 2018 @02:18PM (#18554693)
RE2 is written in C++. Go's regex library is written in pure Go. Russ Cox wrote both of them. Both RE2 and Go's regex library have a Pike VM, a bitstate backtracker, and a one-pass NFA, but RE2 has a lazy DFA which Go lacks. The lazy DFA is a key component for performance in a lot of cases.
Re:ECMAScript regular expressions are getting better (2017) by SiVal on Wednesday November 28, 2018 @06:11PM (#18556566)
Any idea why Cox left it out? Is it just a "we intend to add it but haven't gotten to it yet" or "we don't want it because..."?
Re:ECMAScript regular expressions are getting better (2017) by burntsushi on Wednesday November 28, 2018 @07:05PM (#18556912)
I don't know specifically, but I'd guess the former over the latter. Adding a lazy DFA is a lot of work. There is an issue tracking the addition of a lazy DFA on the golang tracker. My guess is that it's up to a contributor to do it.