From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs. Date: Sat, 14 Aug 2021 08:24:32 +0800 Message-ID: References: <87czqh3b8u.fsf@zoho.eu> <87eeax6w9t.fsf@zoho.eu> <871r6w7vyi.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22025"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 14 02:25:16 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 1mEhUC-0005U0-8Y for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 02:25:16 +0200 Original-Received: from localhost ([::1]:53116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEhUA-0003KP-1m for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 20:25:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEhTj-0003KH-W2 for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 20:24:48 -0400 Original-Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]:40577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEhTi-0005mY-Gs for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 20:24:47 -0400 Original-Received: by mail-lj1-x230.google.com with SMTP id m17so14340398ljp.7 for ; Fri, 13 Aug 2021 17:24:46 -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; bh=62jG1PVDZuibcSvYei083ZpSxKteEJ6BXaL+J/N7AoE=; b=r1rSTZTEg+VgqFe4auTHuZQU1GjqaiVyVtElRjpZ4VliQ7/XJ/cc14CxjgYSxuFv9D Ak/ke5zTFjf6KBBo0dk7m0tAyjsOPmcHWjEO5U+mT+xHxxBqzkgulFzgUvPdIOyJ/qcn GRlWboPDV83v/238hZEEAuO0B1CAKbV0vXYmFm0+hQ3uaoY9SW3V7O0FCHXa6b7+tg5m E8h4946idSvIS9yZ1lz3gNn3hvasFNj+7H+w7Gcp7xVAFM1iUJ1HhRrGbPDs3g9a/SSp csjRzQC4h8Pz8Trh43wElCkNBjZ54DjMXy/R0KBiHCgHoEozjX0bQsnEVjmdWW4Sxcif kulg== 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; bh=62jG1PVDZuibcSvYei083ZpSxKteEJ6BXaL+J/N7AoE=; b=PlMftK0vlqoLeMatGN51uJmMxZai7ZxoY0eRWG9mB5GRA/7XXP/k/OyDmI/wCKrDzh zP+55Ll+wjsKnd/EKhNYOwCgVPGEBCjsgiJcaDngipl9QiRGhxMdnMJcamhJVsYaJeiG UYXhLNzAtMhfaxDu1RqfLXouFCYgBB58Ae5jk1M170MvzTvc8Z2kGpHxcxV6mhzcXWR5 7whzfXAKTNW2jlRVB2xzuSaBSEbPSIxzvK3ymKnBgPGL1wiX4ld9B+wFyIOeDnQTUhJW 3qEjriOXeqF+FFDJB+6F2gPl3N+US9FTrmbqUzaQGwrsm84y0UUZSzJJ99GItYIk6S9S 4Pyg== X-Gm-Message-State: AOAM532MNOLGarlTBX5Uhymn0jDzf/0lEWavl9Ypl0fT8Qw793w8ik5y NlDAtRC556/N5+PDCkq4+CKBe66ktyj27ZXLGqo= X-Google-Smtp-Source: ABdhPJx9KHjuGOZ9aZZZFfjngG8Qkmntp94uJH+D/7WGcnMT5t6w1X+CkOMa7RoXt5qWLosAB0eaO1XLdIKFPxcJRKo= X-Received: by 2002:a05:651c:12c4:: with SMTP id 4mr3537491lje.320.1628900684422; Fri, 13 Aug 2021 17:24:44 -0700 (PDT) In-Reply-To: <871r6w7vyi.fsf@zoho.eu> Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x230.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:132520 Archived-At: On Sat, Aug 14, 2021 at 7:43 AM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > [...] > Forget about the shell script, it is just a wrapper, an > interface for convenience. No, what it amounts to is the use > and combination of 3 tools. (BTW I didn't get the other guy's > suggestion to work, that which only used awk and nothing else > - well, that might be better (I agree) but as for how > difficult it is it is probably *more* difficult than mine > because his requires some understanding of awk beyond the > most basic "pile together a bunch of common tool with their > common/very simple and familiar options".) It's not difficult for me or maybe some others, just too lazy to think for a while. After all, we have so many convenient uinx tools and the excellent (but with performance penalty) pipe method at hand. Anyway, I've presented a comparison between pure AWK and UNIX toolchains as follows: $ time awk 'length > max_length { max_length = length; longest_line = $0 } END { print longest_line }' american-english-exhaustive correspond with someone about someone or something correspond with someone about someone or something real 0m0.255s user 0m0.255s sys 0m0.003s $ time awk '{ print length($0) " " $0; }' american-english-exhaustive | sort -n | tail -1| cut -d ' ' -f2- correspond with someone about someone or something correspond with someone about someone or something real 0m1.794s user 0m1.853s sys 0m0.053s Obviously, the former is about 6 times faster than the latter. > So again there is no shell programming, just awk (gawk(1)), > sort(1) and tail(1). > > $ awk '{ print length($0) " " $0; }' $file | sort -n | tail -1 > > > I hope you realize the difference. And that hypothetical > > *everyone* can also learn how to write elisp if they choose > > so. By the way you know what is also like lego blocks? > > Lisp functions :). > > True but that Lego is too difficult for a lot of people while > everyone can pipe together three shell tools. Hongyi