From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.help Subject: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs. Date: Fri, 13 Aug 2021 15:48:12 +0200 Message-ID: References: <87czqh3b8u.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6701"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 13 15:49:25 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1mEXYq-0001Uc-Te for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 15:49:25 +0200 Original-Received: from localhost ([::1]:42260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEXYo-0003Gn-Vw for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 09:49:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEXXq-0002sG-36 for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 09:48:22 -0400 Original-Received: from mail-vi1eur06olkn2109.outbound.protection.outlook.com ([40.92.17.109]:39157 helo=EUR06-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEXXm-0008L5-5r for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 09:48:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HCO1EBE7j7vqFNWNL12+vC6Ue4zNo4paVsdFdf2wjbPs90LdTI3ZxMPrvcicxvA1iG88qq5P/jWOowVVhaxf7Xy+KY3IvPFhk8NjQbs8w/n+VBxSmELx+6nL1yIpo3HwZuQJCo/VLfU2m1FoJzJ5HgLUz19MAx8dKNrSKbsxfI/fNn0yZOwXg7S42uS+cPCnRxJM0O0yKeaHOWewEl62uJBwZZTipDhSTxal6Lnqxn7brI0QLKfzIKLx7Ljl4CAmwfncdjCk1yxiNFB1cdTgWTWuWY3WzAaQKHMWabnGHiTVbuAmElp9Ouvy0WGFhzF4xhgfGik5tzimdeCL1RVjHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ty6bs5Hn0R+mrnVFPTxhVUYZ9bI43cFIWEKhl/ylCPM=; b=dVyg4y8yoOCq7Wy1iZFFbLMkayG/8VfHf5y00v57eX39F5v44SjGjr/s8u5kMr5HVrYrOHGqSRUUQrgP5Lf/Eer1kkGQ0qJ+Vcwk4aG4S67ZtD9e7oFYi4MGhkl6sElCFWs2v8ynJkqhNH258wU2RKk/AfvyEsaxkFZC1lV3JVskqvtULVTXYaWMyO3pF1eNKw6rIS+usItxsGVgnH0nTEOA8gkvfx0sPoWw0L7VYcJ4yykRcHmsamR/T/stnEJPtaTx8F9L9RvC0WaGyOJXrMxV2QVp9tR16ja7/OK4EL2ymmVNf8c71s7gtw46O7ZWgurdGy4R2I1YGnNdBwZbJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ty6bs5Hn0R+mrnVFPTxhVUYZ9bI43cFIWEKhl/ylCPM=; b=YieznLPu/61r0NXqJmWBxNN9P/575N9hzZvV7n6TF98R1UJnU0PaAXBDFbgZ/5DmcsqwgW4K9n9HIOBC0MhLDA/rN4fi2B6NEYx9RZLcYh9fnOKKpF6mJHNdunayK0fs/5jJn5q78bn9y8iDMlhLDXqzYj0WQjkMRUl5gZ/zKrKrpa1IYUqv4FT/9lm163i/wNrTA6d+YB1Tw5RUeSs4Dx/yb+asA/DV5ryJ79M+pYfkYknbBmt9oIWe/hGFtNVQ0NlcH7jhnSN+9rXnw0eQmB0bTkiVv34mDva2o07YzKMezimFMDJD36x83OxGeC2q5HjmojAXWI0MLpZ7zZgexg== Original-Received: from AM7EUR06FT035.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::52) by AM7EUR06HT151.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Fri, 13 Aug 2021 13:48:13 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc36::51) by AM7EUR06FT035.mail.protection.outlook.com (2a01:111:e400:fc36::156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Fri, 13 Aug 2021 13:48:13 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:1C0E46AB065F39478C6BB9E34CCE74A371A60479A50DB1462E2F2FD92739B98F; UpperCasedChecksum:47483CD8594FC447C7A1BEDE989DAA981D489741D0C17D06F2EB005BDEF4A49D; SizeAsReceived:7562; Count:45 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.019; Fri, 13 Aug 2021 13:48:13 +0000 In-Reply-To: <87czqh3b8u.fsf@zoho.eu> (Emanuel Berg via Users list for the's message of "Fri, 13 Aug 2021 12:11:29 +0200") X-TMN: [jnPOMguyRDOMe0I4qrddeT4ddVmzLFnG] X-ClientProxiedBy: AM6P195CA0066.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::43) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87o8a1wj4z.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM6P195CA0066.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Fri, 13 Aug 2021 13:48:13 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 8256c1f2-62b1-4299-a828-08d95e60fe97 X-MS-TrafficTypeDiagnostic: AM7EUR06HT151: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1RDVkYOlX3UrH5GIE5bkkRJUPXNdecMV7GTG1A1AHyaHK69yunJwJYwO8Reb7Qf1IaA0ciV87dup8T358/3E+XtNueFFReNA0i6Yf2XQJ/jbpLOqWV2JpjQbS4wpROr7MbwpEnHjtfHT7NntcLwtr3jX9EtBFHJ2xTkw4TCsEeqRD6j3Uu7i/2EXovWfiB5FBT+qaayV80S+E5jvrFLb0WCtNClEaNYzfcl0QW8qVyE/7iloJZbhiyuuHGQndvcw65Ormv6Zr5lIvtD1lugbA6Bq9EZFc0vO5Eh01G8zoOMoa4ZMKps2e5reitHzpMjKTkSSDs237bQvWZPnFCrDVJl6DKUnu3tsG1EAfAhFU4SUPlQ5KBUhVzfXbRtFodeOywKF5v62S46AOEp8AbNRq1ekj4ni3/6vVjklHShNB/YrZRDZfSmD18CuKYhTunE2 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2CjMx7FvMWrZz48LpSzD3zqEVIUJvhS8LrIzJaUrxKAe5W3kO8dLjja8KKKTKg1O16ESxMPbs3ck75ugpYfYSOFvHKhxKdD9y334eBbNHnKT3buREs0pDyBlpvggmUdHNDhgYJwDG8LL5/17cKZN1w== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8256c1f2-62b1-4299-a828-08d95e60fe97 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 13:48:13.4692 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT035.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT151 Received-SPF: pass client-ip=40.92.17.109; envelope-from=arthur.miller@live.com; helo=EUR06-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132502 Archived-At: Emanuel Berg via Users list for the GNU Emacs text editor writes: > Arthur Miller wrote: > >> Not to mention, that writing lisp is almost like writing >> pseudo-algorithm. If you reflect over the names chosen in >> that function, you can almost see that it was codded on the >> go, as I was thinking of it. Compare that to pipes and names >> like tr and cut and what not in your original shell >> solution. So it is a kind of simplicity, in my eyes, to use >> just one language, and I guess also a bit of personal >> preferance of course. > > As for development time, if that's the right word, it must be > much, much faster using the shell, which is mostly about Why does it "must be" much much faster to code in shell than elisp? Who says that? :) > combining well known tools often with options and pattern that > return over and over - it is very, very fast. > > Compare - this takes as long to do, as it takes to type it: > > #! /bin/zsh > longest-line () { > local f=$1 > awk '{ print length($0) " " $0; }' $f | sort -n | tail -1 > } > > with this - now, I had a function that worked along similar > lines (ha) so for that reason, it wasn't that slow to write > compared to the shell, without that, I don't know, depends on > the current state/shape :) I really like shell too, and unix philosophy and have been coded shell for like 20 years, compared to elisp which I really started to learn relatively recently, say one year ago, but I find lisp much faster to code than shell. That what you coded there requires knowledge of zshell, awk, sort and tail. If you call it from Emacs you pay four process penalty compared to none if you code it elisp. Not to mention the portability, elisp will work without modification in Windows or Mac too, your shell solution might or might not work as expected. Also if you need to call it in other lisp functions you will have to wrap your shell script in shell-command or start/call-process, so I personally really don't see any point in doing it in shell instead of elisp, because I don't see benefit. But you should of course, choose whatever suits *your* heart and mind :).