From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Tue, 14 Nov 2023 14:20:26 +0200 Message-ID: <80825e58-c239-0c6a-8436-8f57e671e53a@gutov.dev> References: <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <8334xcwank.fsf@gnu.org> <320999cc-6c83-2315-0044-cc0403400af3@gutov.dev> <9ab5d2bd-a648-cae0-a4a7-ae86be10af0f@gutov.dev> <87r0kuqxbf.fsf@gmail.com> <54e115a2-fc36-3056-a030-0dbf32416ddb@gutov.dev> <43f290b0-4119-597b-c89a-0fb4c7db1665@gutov.dev> <6ec0607f-3047-91d3-6a55-40e06fa002fa@gutov.dev> <2580712a-8411-18e7-4cd7-d3a17ed4c50e@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38987"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: =?UTF-8?Q?Gerd_M=c3=b6llmann?= , Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 14 13:21:13 2023 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 1r2sPn-0009qx-8n for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Nov 2023 13:21:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2sPD-0008EX-DT; Tue, 14 Nov 2023 07:20:35 -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 1r2sPB-0008E3-4W for emacs-devel@gnu.org; Tue, 14 Nov 2023 07:20:33 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2sP8-0005ha-CX; Tue, 14 Nov 2023 07:20:31 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5780F5C02AD; Tue, 14 Nov 2023 07:20:29 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 14 Nov 2023 07:20:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1699964429; x=1700050829; bh=rViJ3y0e8jKyxJJMyfNxLfxWSKvNDqb7l8l 9oaZXwgg=; b=hTqFFWJuYZtBtjoqAUfmnl0Ko1F76x/jAyx4vd2U0FBo+lf0lsU C1rYTpw2MpnXGpGFrVuuc4/il7hGnjbIErJ527Pk0tMAm0F5m6BX7ILqVjAJ7Y66 lPXvwtzPj3266o1rpELbQ/oxlWo4apJAdlDwiQOUFhWAJmySakM5npYfmMRIe5bl DEpymt1yiI4tXsXP1p7WqvZOJOxZ8ZjxLd7cH0kz3mF1tW1l23kFwZR34DaHtqrh jbS/dATlPhOHz6LjGUyVjOGtjxnsIA5fJlIAhxJ2GbiAuqPXx1dEc0DwX21wFcg9 KopsoNKHm+vQ20n/t7FsJYk2lQMtHvJjVRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1699964429; x=1700050829; bh=rViJ3y0e8jKyxJJMyfNxLfxWSKvNDqb7l8l 9oaZXwgg=; b=hU8rXxF/4gV1vKouy84KvMCUcNoNCSyqsIFpTVUSSCa6OI19Y0i O/AOY55cU9BsB3Rk0DdRkQv88lobJvJM1E6TiuzKuMvNSG+mus+ph6vedUCj0SWt XcXnlpyRI/dFD9B3CP2r5l6n3b0TitO1LKy7bCzksRsM9hyXSpvduT96wTPEi+7E ucdiie8hbl/qS/W6EQ+QVsamvG0U91Ei4XdZADf1+s5dCtHfoU0PcUFFgl0p8LzK Eb7bvnLd2OEKJZUWLu/eDYh/PfVrd9bkoqRwuZSGJCaKhY92j2eYUE/tFyzdNV8d xEEOC7PI6IBmQS1oBNtm9syO1ctr9f+FIxQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefvddgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Nov 2023 07:20:27 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.29; envelope-from=dmitry@gutov.dev; helo=out5-smtp.messagingengine.com X-Spam_score_int: -64 X-Spam_score: -6.5 X-Spam_bar: ------ X-Spam_report: (-6.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, NICE_REPLY_A=-3.695, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:312727 Archived-At: On 14/11/2023 14:14, João Távora wrote: >> The way I understand this, is any new sequence type has to implement >> seq-do. As soon as that happens, a lot of (probably all) sequence >> functions in seq.el start working on that type. > Right. But seq-difference-3 doesn't call into seq-do anymore, > at least not always and not in the same way. So today,_before_ > your seq-difference "skips-the-seq-do" optimization, a given person's > set difference operations would work just fine for their custom > data type. The person is happy and doesn't care about seq.el's > performance. seq-difference-3 calls seq-filter which calls seq-map, which in turn delegates to seq-do (or a specialized implementation). There is a bug in my prototype patch -- the absence of the type check inside seq-contains-pred. I think it should be a specialized impl for seq-contains-pred anyway (for when sequence is a list). Since seq-contains-pred is only called once, that shouldn't have any measurable effect on performance, aside from very tiny lists. > One day they upgrade seq.el which comes with your optimization to > seq-difference, and that code is mysteriously broken. Worse for some > equality predicates it is broken in a given way, for other equality > predicates it's a different error. > > Can't you see the fundamental problem? > > Right, but then if they fail the customization of the entry point > generic like not calling the right generics at the right time, then > _other_ customizations of_other_ generics won't be called, or will > be called too much. Just like in your seq-difference-3 optimization > the user code breaks. >>> cl-{n}set-difference are standard stuff in the CL world. There are even >>> reference LOOP implementations (likely much more performant than ours, >>> though possibly not compatible with some non-standard edge cases our >>> cl-loop has of which I know a couple). >> I do believe it's helpful to have it around. > What is? cl-lib.