unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs.
Date: Fri, 13 Aug 2021 15:48:12 +0200	[thread overview]
Message-ID: <AM9PR09MB49775552F7E0670A01DB4C1D96FA9@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
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")

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> 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 :). 



  parent reply	other threads:[~2021-08-13 13:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  7:12 Too fine design granularity leads to numerous macro/function/command existed in Emacs Hongyi Zhao
2021-08-13  7:25 ` Eli Zaretskii
2021-08-14  0:46   ` Hongyi Zhao
2021-08-14  6:18     ` Eli Zaretskii
2021-08-14  6:29       ` Hongyi Zhao
2021-08-14  7:18         ` Eli Zaretskii
2021-08-14  7:25           ` Hongyi Zhao
2021-08-14  7:47             ` Eli Zaretskii
2021-08-13  7:57 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13  8:34   ` Hongyi Zhao
2021-08-13  8:56     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13  9:20       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13  9:26 ` Arthur Miller
2021-08-13 10:11   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 13:00     ` [OFF TOPIC] Algorithms (was: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs.) 2QdxY4RzWzUUiLuE
2021-08-13 13:07       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 13:17         ` Yuri Khan
2021-08-13 13:26           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 13:48     ` Arthur Miller [this message]
2021-08-13 18:21       ` Too fine design granularity leads to numerous macro/function/command existed in Emacs Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 20:47         ` Arthur Miller
2021-08-13 23:42           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14  0:24             ` Hongyi Zhao
2021-08-14  0:42               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14  1:02                 ` Hongyi Zhao
2021-08-14  2:18                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-14  1:46             ` Arthur Miller
2021-08-13 23:49         ` Hongyi Zhao
2021-08-13 23:54           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 14:15   ` Eli Zaretskii
2021-08-13 14:42     ` Arthur Miller
2021-08-13 15:59       ` Eli Zaretskii
2021-08-13 17:09         ` Arthur Miller
2021-08-13 18:16       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 23:40       ` Hongyi Zhao
2021-08-13 23:45         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 23:57           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-13 23:47         ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB49775552F7E0670A01DB4C1D96FA9@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).