Earlier quoted context omitted.
It sounds like someone read Russ Cox's work on regexp. Russ Cox? You know that regular expressions have existed since Kleene's first proposals, and everyone with a CS degrees knows that you can compile them to deterministic finite state automata. Right?
And that's why the RE2 implementation has existed equally long! Oh, wait.
Vim 7.4 is released
11–20 of 126 posts
Re: Vim 7.4 is released
#12Re: Vim 7.4 is released
#13:help version7.4 has all the details, but the two most significant ones cited are "New regexp engine" and "A more pythonic Python interface." Of the former, the help file says: What is now called the "old" regexp engine uses a backtracking algorithm. It tries to match the pattern with the text in one way, and when that fails it goes back and tries another way. This works fine for simple patterns, but complex patterns…
The initial work was done in a 2008 Summer of Code project: http://code.google.com/p/vim-soc2008-regexp/source/list
but there were lots of fiddly issues with character classes and Unicode handling, a need for exact equivalence to the old regex engine to avoid arbitrarily breaking existing scripts, and a need for a comprehensive test suite, all of which took a while for people to supply.
Re: Vim 7.4 is released
#14Earlier quoted context omitted.
It sounds like someone read Russ Cox's work on regexp. http://swtch.com/~rsc/regexp/ To future regexp implementors: Do it this way first!
It sounds like someone read Russ Cox's work on regexp. Russ Cox? You know that regular expressions have existed since Kleene's first proposals, and everyone with a CS degrees knows that you can compile them to deterministic finite state automata. Right?
Re: Vim 7.4 is released
#15Very nice! Does anyone remember that nifty syntax highlighting script from a while ago that required a recentish version of Vim? I'll install 7.4 and want to try that out, but I don't remember what it was...
Re: Vim 7.4 is released
#16And still no viable competitor to emacs.
Re: Vim 7.4 is released
#17Very nice! Does anyone remember that nifty syntax highlighting script from a while ago that required a recentish version of Vim? I'll install 7.4 and want to try that out, but I don't remember what it was...
It’s not syntax highlighting, but it needs a recent version of Vim: http://valloric.github.io/YouCompleteMe/ ?
Re: Vim 7.4 is released
#18Earlier quoted context omitted.
And that's why the RE2 implementation has existed equally long! Oh, wait.
Cox's work builds on Thompson's work from the 60s. He says so himself.
The classic DFA engines, like in Thompson's version of grep, provide a fairly minimal regex language (later standardized as POSIX regexes), not much fancier than the regular-language syntax used in textbooks. Perl-style regular expressions get such widespread usage even outside of Perl in part because they have a more full-featured syntax, which provides conveniences people find useful. Cox implemented a significant subset of this functionality as syntactic sugar on top of a classic automaton regex engine, so RE2, unlike POSIX regexes, supports named matches, named character classes like \d (plus Unicode character classes), non-greedy matches, etc. Basically everything that can be done without making the language nonregular, so excluding lookahead, lookbehind, and backreferences.
Since vim regexes (a custom dialect) support some of those supra-POSIX features, those implementation techniques were likely useful for them to look at. Indeed they link to Cox's article somewhere or other in the design docs.
Vim does have lookahead/lookbehind syntax, though; I wonder how they supported that. Fallback to the backtracking engine?
Re: Vim 7.4 is released
#19Complete Changelog ftp://ftp.vim.org/pub/vim/patches/7.3/README (it includes all changes from 7.3 up to 7.4) New patches for 7.4 will be in the patches/7.4 folder.
This is ridiculous.