help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Too fine design granularity leads to numerous macro/function/command


From: Hongyi Zhao
Subject: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs.
Date: Sat, 14 Aug 2021 08:46:27 +0800

On Fri, Aug 13, 2021 at 3:26 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Hongyi Zhao <hongyi.zhao@gmail.com>
> > 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]