From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 938d252 4/4: Make regex matching reentrant; update syntax during match Date: Sun, 17 Jun 2018 15:30:42 -0400 Message-ID: References: <20180616204650.8423.73499@vcs0.savannah.gnu.org> <20180616204653.86AFC203CB@vcs0.savannah.gnu.org> <04e89d2beffedcc102b811863910c1ec.squirrel@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529263731 9544 195.159.176.226 (17 Jun 2018 19:28:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Jun 2018 19:28:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: "Daniel Colascione" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 17 21:28:46 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUdLw-0002K8-CH for ged-emacs-devel@m.gmane.org; Sun, 17 Jun 2018 21:28:44 +0200 Original-Received: from localhost ([::1]:56209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUdO3-0001oe-Ds for ged-emacs-devel@m.gmane.org; Sun, 17 Jun 2018 15:30:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUdNx-0001oZ-2x for emacs-devel@gnu.org; Sun, 17 Jun 2018 15:30:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUdNt-0006WZ-W3 for emacs-devel@gnu.org; Sun, 17 Jun 2018 15:30:49 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:38986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUdNt-0006WT-Qc for emacs-devel@gnu.org; Sun, 17 Jun 2018 15:30:45 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w5HJVDmv016231; Sun, 17 Jun 2018 15:31:13 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 93471656ED; Sun, 17 Jun 2018 15:30:42 -0400 (EDT) In-Reply-To: <04e89d2beffedcc102b811863910c1ec.squirrel@dancol.org> (Daniel Colascione's message of "Sun, 17 Jun 2018 11:51:33 -0700") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6309=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6309> : inlines <6702> : streams <1789972> : uri <2659834> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226426 Archived-At: > Good idea. My reading of the "smart jump" stuff in regex.c suggested that > we use the optimization for _all_ greedy Kleene star constructs though, > not just the bounded ones. Am I wrong? Oh, right, I forgot about that lazy optimization. We'd need to fix this so the optimization is performed eagerly. > But anyway, I think the regex code needs a major overhaul. Yes, but it's a fairly major project. > I was actually thinking about forking and vendoring RE2. Granted, > having done that, you'd need a C++ compiler to build Emacs, but it's > probably one of the better actively-maintained DFA-based regex > engines around. Yes, it's a nice library, but we'd need to add support for back-references, which doesn't seem straightforward (I think the easiest would be to fallback on the old regex engine when backrefs are present, but keeping two completely different regexp engines is a real PITA). Stefan