From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Bj=C3=B6rn?= Bidar Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] add compiled regexp primitive lisp object Date: Tue, 24 Dec 2024 23:16:15 +0200 Message-ID: <45276.3791241281$1735075027@news.gmane.org> References: <87mslxxddk.fsf@protonmail.com> <5He97LtsyeyQoTLU7d91oP2CLO8s_2afdgcNxozsFjzu8qGbB_7nXmsZL5O6Ej7K-tuEmngCcPKJpDAjxeKz4jk1DvqSUbdOLpw5U1vo1SY=@hypnicjerk.ai> <87le1avopk.fsf@protonmail.com> <2LOLmIp1X8w4CGbqq3qDrzmKVA0KzYNL1N9lBtWdB-MtEv9oCuYgJMYprG170wMPjYxeQImAmWOPatGTTl4KxZMlptNo9A9hnHt84vdN9EA=@hypnicjerk.ai> <87ttfxtszi.fsf@protonmail.com> <86r0b1o5sr.fsf@gnu.org> <868qx8o83w.fsf@gnu.org> <875xscec62.fsf@gmail.com> <87o764sb6y.fsf@gmail.com> <87a5cn7cnu.fsf@localhost> <86cyhj5xmc.fsf@gnu.org> <87ttavlc50.fsf@localhost> <86a5cn5v1n.fsf@gnu.org> <87r05zlas8.fsf@localhost> <8634ie60jd.fsf@gnu.org> <87y106jr4i.fsf@localhost> <868qs64a65.fsf@gnu.org> <87seqejpf9.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37666"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , monnier@iro.umontreal.ca, mattiase@acm.org, arstoffel@gmail.com, eller.helmut@gmail.com, dmcc2@hypnicjerk.ai, pipcet@protonmail.com, emacs-devel@gnu.org, acorallo@gnu.org, stefankangas@gmail.com To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 24 22:17:00 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tQCGx-0009d5-Qj for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 22:17:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQCGP-00040G-CB; Tue, 24 Dec 2024 16:16:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQCGL-0003wX-8N for emacs-devel@gnu.org; Tue, 24 Dec 2024 16:16:22 -0500 Original-Received: from thaodan.de ([185.216.177.71]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQCGJ-0002DV-L7; Tue, 24 Dec 2024 16:16:21 -0500 Original-Received: from odin (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id 443F3D0004B; Tue, 24 Dec 2024 23:16:16 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1735074976; bh=SGBErrfHKNVKOzeAcU2i8HFuHY4TwBOE8yYaQmXeM5A=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=rbQDWG7JBkMrzENP4grZ8zcD9z6LQ773Th/rtmifseAcBeAzTDTPOjLjFagvebSiy 3ctCMLvwfxQJnFkdQYUnZ2w3pwb/x/ooN4B4GvoFf2UzP9IHsCYB92ubGePN/2pz9c 6ApfJzL5FT0xpBXKL5xdBK0Sxw5wy+5r2OehkQiBqf+Ob2gV/b8Bv+EXqWG7hxSgG4 tv8XMCgKuDklyi66UWQLXz19BbFLCm5HkrWJSnpClC2VD86XXx21sKtCeSC2GDpUZN tndjeJvhTxOpBucuvQSVZuPqEsjQDW3vht3f6laCklFRDLlRDWHUkH5pWhYOQ7Scu6 UYnVND0T7lRUqtzhekmpK8gO+/6ApRqfBD/LzxwVBa70dR1YMrkmgaGOvWtIhkb0xz weyNm5HKLmpbP4qHuuSUtjjnXsk6nKMZE9E9QS5duPA7F+gKtfUSZ+dFDnxY38qOzi p8lL7H1RLnhO0wYSqGpvadCW+H5xihx8nwckMcrs7weEZ1lL4G2CYa4B+lRuRX4NOK wctU8/FReN2iIRD4na9uh0u3zPUwjeZExz+CChDIaWbf2/7lmAVC4PpFSD2kArAN4o azu7BZINZAk+z/4M9864jCwVI6551XMBsvK3EHY8fxz9WFVtwraKjuHomsUbUn7CCV Oft86lqBQCZkwpqgnwp98CvE= In-Reply-To: <87seqejpf9.fsf@localhost> (Ihor Radchenko's message of "Mon, 23 Dec 2024 17:10:34 +0000") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH Received-SPF: pass client-ip=185.216.177.71; envelope-from=bjorn.bidar@thaodan.de; helo=thaodan.de X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, INVALID_MSGID=0.568, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327032 Archived-At: Ihor Radchenko writes: > Eli Zaretskii writes: > >>> 2. They could maybe even be constructed from Elisp, opening >>> opportunities for custom regexp compilers that can be tailored to >>> specific application needs rather than having to stick to hard-coded >>> generic tradeoffs Emacs has to do without knowing the purpose of a >>> regexp. >> >> How will this help making matching faster, and why does this have to >> be via compiled regexp objects? > > My motivation is > https://burntsushi.net/regex-internals/#literal-extraction that explains > how regexp compilation depends on certain heuristics. > > For example, when searching for "\\(foo\\|bar\\)[a-z]+", heuristics > invoking simple string literal search for "foo" and "bar" first before > using heavy regexp automata is justified. Not so much when the prefix is > simply " " that usually occurs very frequently in text. I want to highlight that is example would already cover many of the operations which modes do for example for fontification or text-extraction.