From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Tue, 05 Dec 2023 11:45:36 +0100 Message-ID: <87o7f57wrz.fsf@dataswamp.org> References: <871qd8sfdx.fsf@posteo.net> <838r7g8pys.fsf@gnu.org> <87bkcbrgnr.fsf@posteo.net> <25924.21015.19614.951576@orion.rgrjr.com> <87bkc4jpja.fsf@dataswamp.org> <12da6bcb-1818-7fbe-12af-8d4607724332@gutov.dev> <87il6bt4z0.fsf@yahoo.com> <87y1f6s3eb.fsf@yahoo.com> <878r75sqby.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23461"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:WZvpyOR8BG/o9LZzR7A7BgeF2bM= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 05 13:02:01 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 1rAU7k-0005rQ-6N for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Dec 2023 13:02:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAU6w-0004z0-Hs; Tue, 05 Dec 2023 07:01:10 -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 1rASw4-0004cL-U4 for emacs-devel@gnu.org; Tue, 05 Dec 2023 05:45:52 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rASw2-0004pw-2j for emacs-devel@gnu.org; Tue, 05 Dec 2023 05:45:52 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rASvy-0009SS-K9 for emacs-devel@gnu.org; Tue, 05 Dec 2023 11:45:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 05 Dec 2023 07:00:58 -0500 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:313539 Archived-At: Dmitry Gutov wrote: >>> Why do you exempt yourself from this irresponsibility? >>> Can't you see this is all subjective and it seems a bit >>> arrogant to say "my code is so responsible"?? >> >> Thus far there have been no complaints that code_without_ >> cl-lib, pcase, seq or elt is unreadable. Most of our code >> (this time measured by lines) falls squarely within >> that category. > > Without having a specific enemy to blame, when the function > is long, people just either admit out loud they find the > code difficult or silently avoid changing it. The way people have been writing Elisp in functions that are so long it is insane always puzzled me. I mean, not because they were so long - just look at the Gnus source for example - but why they were written like that to begin with? Also the files themselves are so long? (Maybe because they are made up of so long functions LOL.) In my own Elisp I never had that problem of almost endless functions. But I'm unsure why, maybe people solved much more difficult problems then? *impressed* *envious* But I think cl-lib and pcase should make the code more compact (i.e., shorter lines for the same job). So yeah, it is less complexity in the sense fewer lines and more standard library usage. But also more complexity in the sense people have to learn the basics of cl-lib and pcase, at the very least, including their mini-languages (e.g. `cl-loop'), and further not be frustrated by what they can't learn by heart the way they once mastered Elisp but must look up in docstrings when encountered. One can also hope that the most common use cases of cl-lib and pcase will in time be idiomatic as well - so even tho you don't know the whole library or construct by heart, the way they are usually applied, that will be familiar enough to the trained eyes of Emacs maintainers and contributors. For example, I'm sure many people are fond of their scientific calculators. And are quite fluent with those. But no one knows what all these functions and buttons, every single one, actually do, right? -- underground experts united https://dataswamp.org/~incal