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:46:27 +0800 Message-ID: References: <838s15dcwl.fsf@gnu.org> 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="39928"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 14 02:47:30 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 1mEhpi-000A19-PS for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 02:47:30 +0200 Original-Received: from localhost ([::1]:55896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEhpc-0006Yu-CK for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 20:47:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEhox-0006Yi-4n for help-gnu-emacs@gnu.org; Fri, 13 Aug 2021 20:46:43 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:37681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEhov-0004JF-Pa; Fri, 13 Aug 2021 20:46:42 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id d16so29509ljq.4; Fri, 13 Aug 2021 17:46:40 -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=of0yLKoSk3TZLyTK1SVqou0dWC6C8D8ltbHme1SdUM0=; b=PFSSIRdDyCr9htWp75iu94FWlALqi6WSv1MmvpQzaQE0PbzLClrv38SPFblqx06uyJ Men5UmUss6FfgKesTgCgUff4ghz5EqrHfnNMSMOTyw0LikMQwrqjdyjmg2TW5BWlODRb jHkNq/84r0b1NhTVdu04fEWvnysWHstLS0YboP6sxl79Wj2IzXUHtIdlb1WVP4Sp3XNc Bpev+QnuToh3pDHC4OdWVejRxsIKHJHgBf9NhFayfP9G5EM2bbCk4v2EGBfjo+X4IyDw eu7CHqCYaOdiJQb4UVwXqwM1In7WZUWlK3rpc0gbt8lCrnfRtCdGetgDEJO/HnbppRvG kuEw== 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=of0yLKoSk3TZLyTK1SVqou0dWC6C8D8ltbHme1SdUM0=; b=GW6KWB0LNkwYZxxJOWFWDVMgG3oZng/2B2JmnZ+1UbsdQCyYeKjmBf1kEbMQEITKCr mNnvoHQ3MT/LgXQl883ZDqsu8s38CCi1Zav4S/+8v8Up4DnyrteSw/QAFzboHR8gPtKt qJMhY9sY+ITv9+ozbwxZdAniP9baR8M3KQWXNNtu2ZHUjYG5wiRb/P6lncosWRFuiy+3 4kxXjWa1MNcM3sT3RwMEaellH6EgFbwaeXc9zZXaPFJPhiorAwT/fZUbEXSho8XtvOJK caGTmiLuv/aHbMH3zxU6J0Khnn5VI5MTdnSJ2s1VhXyCoE3m5sDymzCJePdf0HWNhAQS uY5w== X-Gm-Message-State: AOAM533nEAZGiRah3uJIuONteiLGYzXQZSHdG/VGZXj5oGzzfaLB2W7a 5P3zTX0D805nn9Ap1USljhFwZzuFyawfrVHkIg9RkQQcdKqvFFaJT5Q= X-Google-Smtp-Source: ABdhPJxcRB9hItM5lMWvgi5Qfs8WJj4sxnJE0MGZL1mtVtr2laxh3yN2D467qclGeXRat3MtC+/Tr1sCUbSUJhKfxyU= X-Received: by 2002:a2e:bd0c:: with SMTP id n12mr3604430ljq.447.1628901998859; Fri, 13 Aug 2021 17:46:38 -0700 (PDT) In-Reply-To: <838s15dcwl.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x236.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:132522 Archived-At: On Fri, Aug 13, 2021 at 3:26 PM Eli Zaretskii wrote: > > > From: Hongyi Zhao > > Date: Fri, 13 Aug 2021 15:12:39 +0800 > > > > 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 > > do all the jobs of the above two functions by adjusting its > > `-maxdepth' and `-mindepth' arguments. > > > > So, I want to know why these macro/function/command in Emacs are > > developed with such a fine granularity. > > They aren't. You provided just one example, and drew far-reaching > conclusions from that single example. If you want to make such a > general claim, please show more examples of what you consider to be > "fine granularity". > > Specifically about the one example you provided: directory-files is a > primitive, written in C, so it provides the basic functionality of > fetching file names from a single directory. The > directory-files-recursively function is written in Lisp, it builds on > that primitive and provides extended functionality. Thank you for letting me know this difference, which I really didn't notice before. But there's still one question I don't understand: C is a compiled language, so how does the compilation and invocation of such C primitives work in Emacs? Are they compiled into libraries and called in real time? > This paradigm, of having primitives provide the basics and implement the rest in Lisp on > top of those primitives, is central to Emacs design. Thank you for introducing me to this central paradigm. Hongyi