From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Philippe Vaucher Newsgroups: gmane.emacs.devel Subject: Re: Imports / inclusion of s.el into Emacs Date: Fri, 1 May 2020 20:05:22 +0200 Message-ID: References: <266155d4-f9c0-8ed3-8df5-32feea171076@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f2524705a49a079a" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="122549"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 01 20:09:00 2020 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 1jUa5s-000VmA-ED for ged-emacs-devel@m.gmane-mx.org; Fri, 01 May 2020 20:09:00 +0200 Original-Received: from localhost ([::1]:45356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUa5r-00008Y-Fh for ged-emacs-devel@m.gmane-mx.org; Fri, 01 May 2020 14:08:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUa4w-0007iv-DV for emacs-devel@gnu.org; Fri, 01 May 2020 14:08:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUa2q-00066v-5O for emacs-devel@gnu.org; Fri, 01 May 2020 14:08:02 -0400 Original-Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:33938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUa2p-0005y4-3B for emacs-devel@gnu.org; Fri, 01 May 2020 14:05:51 -0400 Original-Received: by mail-lj1-x22d.google.com with SMTP id f11so3390954ljp.1 for ; Fri, 01 May 2020 11:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6VsxdCZtUHZGslpepHzhb+aKRAqROlxAc98eqylw84o=; b=ItPgbVghAFKUEkYijzNXVnYEJFu01wmhT1+aznLkiZmR1RdamOzKwDX3h7ngn47X48 KtBatWIUzHs3L1AxFiVnF6b78ArFn5tV65I1nHOJgcO2ijEtThhBBubRShaL4JVx2470 BD751CUfKJTtLHkTZ2ogwW25f5Bw/Sfs6RopCQqswtBQYk2dtxgOIN0wQVvdNQxuxHPV Hoa/EN/8Qml180kcuz0lF67dr56Wb1sQ4vbwSA9GcVli43Cat7PtKrd9iFBwGdaQ640k AfuDrmzGLtqfNrqgi0sDeiQAwcFjqfEngB7Z1nthZa7OHNrDCned/qBNyat95lw3ZmCs QY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6VsxdCZtUHZGslpepHzhb+aKRAqROlxAc98eqylw84o=; b=sc5pcUzYJRb0CUvhc09l9oh5YUKF9NsQuuRciAbWeVTtdD6dlqLONYXESH5/LP5YBp mkfEY7V66eEfPlwaMufWw/OwimvuyQM+387Ivm3xvKCbcUZ124XmLjzuuXl7IIUYnCkK oJd2c30OSblwoYWq+mt4Vz3MornC/izB9FCXJzWAYXLXjupLD3fk5hdTDHVy+E0XDPYC M1X1ADdfF/TYfwjDSj5juYSlPZFWtArqhPw9t91aEnXztde3NYpBeXl2rjVP6VRMS8dy rsH5q8BzUpINPBp9kWxX2yzHJk5z4prsGKfoBEnSLiUt6ZLcaJ0TsBbbL5iJUQZgbK8q RAtw== X-Gm-Message-State: AGi0PuYKuPt1INJTXnw7JHMUPJ70m08w09BLx2Oq8udakjsa2IEEpq6/ HylJM9cJLJD7JjJhR4AjxkUKsx7Qfe+N1g3gS74= X-Google-Smtp-Source: APiQypIRp5AzW6KD8Q6Cy6ZraMIF5Qy0/DGpcdpnEVpoE1W4bju/MyasHI2DFXPB8gD8BRsf30t8p6k9JBc8+bWFfS4= X-Received: by 2002:a2e:9e97:: with SMTP id f23mr2966486ljk.228.1588356348784; Fri, 01 May 2020 11:05:48 -0700 (PDT) In-Reply-To: <266155d4-f9c0-8ed3-8df5-32feea171076@yandex.ru> Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philippe.vaucher@gmail.com; helo=mail-lj1-x22d.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:248326 Archived-At: --000000000000f2524705a49a079a Content-Type: text/plain; charset="UTF-8" > I'm not completely sold on its contents for the core, however: a lot of > it looks like a compatibility layer for Clojure's familiarity's sake, > with very thin wrappers (which basically just add the cost of function > invocation). > > 1. s-prepend/s-append: trivially replaced by 'concat'. I'd like to get more insights about this point. I think it's a point that comes back fairly often here, and I'm not sure I fully understand why. I'll try to explain my side first so you see where I'm coming from. So, I guess a lot of s.el users think it's a massive improvement over what emacs has to offer reguarding string manipulations. This is visible in issues like https://github.com/magnars/s.el/issues/88. I never coded with clojure, but my argument for these helpers is that in code we do string manipulations all the time, they are trivial to write, so why not have trivial helpers. I understand there's a limit to such helpers because you could write thousands of them, so good taste should be used to introduce "the minimal set". I usually don't care about these extra function calls, what matters more to me is how beautiful the code looks and how readable it is. If performance becomes a concern, then I usually first improve the algorithm or switch to C++, and only at last measure do I resort to these "micro optimisations" like avoiding a function call. Because string manipulation is so trivial, I'd like them to be grouped together so they are easy to find. In other languages I can usually go to one page and have the list of all strings related functions. In Emacs the manual at https://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Characters.html while helpful makes it hard to "read it all" and find what you are looking for. For example I couldn't find concat on that page. >From your side, I understand that your definition of the minimal set is much thiner, and maybe what would help is to give the complete list of the functions you find superfluous and why (list at https://github.com/magnars/s.el so far you mention `s-prepend` and `s-append`). For example I'd disagree if you said `s-left` and `s-right` are not useful to import because it can be done with `substring`. Philippe --000000000000f2524705a49a079a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I'm not completely sold o= n its contents for the core, however: a lot of
it looks like a compatibility layer for Clojure's familiarity's sak= e,
with very thin wrappers (which basically just add the cost of function
invocation).

1. s-prepend/s-append: trivially replaced by 'concat'.

I'd like to get more insights about this point.= I think it's a point that comes back fairly often here, and I'm no= t sure I fully understand why.

I'll try to exp= lain my side first so you see where I'm coming from.=C2=A0So, I guess a= lot of s.el users think it's a massive improvement over what emacs has= to offer reguarding string manipulations. This is visible in issues like= =C2=A0https://github.= com/magnars/s.el/issues/88. I never coded with clojure, but my argument= for these helpers is that in code we do string manipulations all the time,= they are trivial to write, so why not have trivial helpers. I understand t= here's a limit to such helpers because you could write thousands of the= m, so good taste should be used to introduce "the minimal set". I= usually don't care about these extra function calls, what matters more= to me is how beautiful the code looks and how readable it is. If performan= ce becomes a concern, then I usually first improve the algorithm or switch = to C++, and only at last measure do I resort to these "micro optimisat= ions" like avoiding a function call. Because string manipulation is so= trivial, I'd like them to be grouped together so they are easy to find= . In other languages I can usually go to one page and have the list of all = strings related functions. In Emacs the manual at=C2=A0https://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Ch= aracters.html=C2=A0while helpful makes it hard to "read it all&quo= t; and find what you are looking for. For example I couldn't find conca= t on that page.

From your side, I understand that = your definition of the minimal set is much thiner, and maybe what would hel= p is to give the complete list of the functions you find superfluous and wh= y (list at=C2=A0https://github.= com/magnars/s.el=C2=A0so far you mention `s-prepend` and `s-append`). F= or example I'd disagree if you said `s-left` and `s-right` are not usef= ul to import because it can be done with `substring`.

<= div>Philippe
--000000000000f2524705a49a079a--