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 11:26:39 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27319"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 13 11:27:13 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 1mETT5-0006q8-L0 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 11:27:13 +0200 Original-Received: from localhost ([::1]:41346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mETT4-00006I-4M for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 05:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mETSh-000069-Cd for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 05:26:47 -0400 Original-Received: from mail-oln040092075046.outbound.protection.outlook.com ([40.92.75.46]:38175 helo=EUR04-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 1mETSe-0004xC-7k for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 05:26:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QeAgGIXlh9cmKlAE9vMXvTwx+aNZu5PwnuWi7TvE7C0qk2WdKsmqMGRlGXpzkumx3d2dTbAaL1oI0LRaECZrua2S5woGZ4dVLAmME4L+bFjM3TxSvuoSxa9aPtVUZgQApLEzgN2MJB04v49uK1JTEzFDzyTNwBIqG0Ens/Mv6txtSQEtajTPzbbPwdIBd+VvnUvByz5YJQeytGzF/fUKt46eri2lxNHbMAaVW+OYX03sBLtR/Qme43Pqyv5FV2qawaXCYceqlJULbWDPFW8ETJO32mgEp1j/urJSHGdozEuSGl8rQXM35ubQ4HIG5kF2dpow5nk20Yr3Qyqkk12k0g== 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=SZwwJeJaR3WwYGarsAT3NR+wFQT++t81TBaMuYtrIME=; b=B7xZ8lS08bcwLW7hfKPbN2QSSGz6Ixe00x/CDv//xUVTnFqLl7GVEUa/Aq98zbXR+tvo2WrVpYwfHfzyG92OK/yTzbBUcPd1Q6Ub8gCBp+kiFoBSOkxOUR5X7C2nE6hik5O4wFBz/64lNPcmkRvRDYtNQFm8VXJOgRetZIYjx3/8g1sj1HD+PZWYc8E675iiDbzo9o1yMiZYp3WIh9lMhNFoWJt1nuhxt1l9QFUSlfKcSKh1Y1dIjpOsje5Wwu1j+6b8qUVVMePgYz+wdIyfoVuPnq/KioWFu0NK9l/jHDX/qghnNmaaPHH5CVHHoV8BWqlYaCuIzQeCjvvscRCKJA== 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=SZwwJeJaR3WwYGarsAT3NR+wFQT++t81TBaMuYtrIME=; b=uv4/9q3oKeKBcI7cY+K1zaxPqhlHBGFHp/RB8/9397DgBfQJRPQx7pPduNpZx5+7UZp36gKFGCb7jbQMkdRS2D7yk8oqpxKqCJOEvAwQCq9cuSAeFNQOQq9NP4RX+EbxRL53YNulIC7fjuq65Z8uVdjJbLYKyWYeuo0FaEu03+tS1op8OtgSulqRDF0obJ4VTWNI2ar6VhzBO3fomq88X+0APoCOawPZXhnRPp0m/WCgjtXbGvTJqHZ+5MNZ2seM8WnnvbKTcSVT7xA+FP4PsQnGR8AqAldVTIwPj4UquQBo0CbXAmjQdF7DAIoiR4lcSB/2D8XI2q/Q/IFFo7X9/A== Original-Received: from VI1EUR04FT054.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::44) by VI1EUR04HT090.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::321) 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 09:26:40 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0e::4b) by VI1EUR04FT054.mail.protection.outlook.com (2a01:111:e400:7e0e::329) 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 09:26:40 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:09B0948EA19A432CEA6937FE98E7ACA72EE56B1450811D5CD3578746B08C72BA; UpperCasedChecksum:5C5A31C6661B3041974F16B8E52BAC829ED348B9B5D7C9BCDD3DAB770986E1E8; SizeAsReceived:7532; Count:46 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 09:26:40 +0000 In-Reply-To: (Hongyi Zhao's message of "Fri, 13 Aug 2021 15:12:39 +0800") X-TMN: [rRFegwNnkCpkC/RSX2S8pf+asZnpMF5A] X-ClientProxiedBy: AM6PR10CA0060.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::37) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87wnopwv8w.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM6PR10CA0060.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::37) 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 09:26:39 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: acdc3123-603e-492f-087e-08d95e3c7496 X-MS-TrafficTypeDiagnostic: VI1EUR04HT090: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TuN0X1+Vw3l40zzlgi5qzEN5JMwHAixT0UhOSNNWtiCRgIVIf3uG5Eik8+wRj7gXbew+m3F0kUQZXJ5BTWskMUv6h/wRTrGf4X0gbNNkItGD+xsiAk1Dm/TCBw5WXglatZ8NRSjAY1zgGtWHvEnWJYOHcjYceEYslcPXQYBMIPNe1ui33/aY1MN+3dQJuooZ78WvpBnqP8S7iL2ay5rfRLd7jzgjP6WwlzxXi41FiXPq9P/nK8YfEyxyQd0AS72XB4o2HMUg4EA1J+F+R9Bm11eZIc4ZbWJQ7EsufYutA7ljcL/NXIbbuioMsXaU22uxifGOb+5nG4u7prmZwQjCFoQdlpbV1XzTwjsavjFAbajLZYpx5FMQT0fuZLxmRD4JeXID2tRSp0Ej+Y4puuAWV8QhXTO7mIZ4NQBSD94CI+NjKHNDYTXA3yImNm8Qxnlt X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eXZe4rqcTJyU1rcWjuaB+JPOjmTfUvcZ/J8Att44SfBPV2UtOZGV+1c8NQW0TWg+7JneEvrepZqMuqIcuoadDqK3Nh8Ah6psgqfkreJYbzkzTWLjfhOMxpFLNtKFHpT30dB6aToL5w9d++1tuw7aXQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: acdc3123-603e-492f-087e-08d95e3c7496 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 09:26:40.1423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT054.eop-eur04.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: VI1EUR04HT090 Received-SPF: pass client-ip=40.92.75.46; envelope-from=arthur.miller@live.com; helo=EUR04-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:132496 Archived-At: Hongyi Zhao writes: > It's well known that Emacs has already implemented numerous > macro/function/command in its current version. But it seems that this > is caused by, to a certain degree, the too fine granularity, i.e., > there are many functionally similar macro/function/command are > designed separately, for example, `directory-files' and > `directory-files-recursively'. The traditional Unix tool, `find', can I wouldn't say that these are "very" similar. Sure they both list files, but a recursive lister vs. plain lister is a big difference. You can implement recursive lister with directory-files, I have done it myself sometime, but `directory-files-recursively' is much nicer and time saving. I wouldn't say it is "fine granularity" there, rather very rough granularity :). > The traditional Unix tool, `find', can > do all the jobs of the above two functions by adjusting its > `-maxdepth' and `-mindepth' arguments. Sure, so can others too. But nice thing wiht having it in elisp is that is more straightforward to use. You have only one language to code in as opposed to shell or whatever your tool needs etc. Also it is portable to systems that don't have those tools installed. You also save some time in process creation. Depending on complexity of your directory tree and what you are trying to accomplish, it can be costly. Compare to your shell script to give you longest string from the other day. It involved several unix tools and thus several processes had to be created, as opposed to none in the pure elisp case as you got from Thomas or me. In a case where you have big files with millions of lines, unix toolchain would probably win performance wise; I don't know where the cutoff is. But in the case of not so big file, I think the pure elisp wins, resource and performance wisely. 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.