I've used Spacemacs for some years now as my primary editor, but recently I've been looking into #neovim.

It starts up a lot quicker, even with a bunch of plugins, and surprisingly for a terminal editor it has a more sophisticated UI than windowed Emacs.

@weavejester I’ve been using #vim for nearly 30 years :facepalm:. #neovim has re-wired my workflow.
Yes, #emacs fans will tell you the same about their #editor — but these tools aren’t just rivals, they represent opposing philosophies. Vim/Neovim: speed, composability, the Unix ethos. Emacs: the “OS inside your editor,” everything bundled in. Both have strengths, but they reveal two very different ways of thinking about code, control, and workflow.

@demiguru

I understand that emacs is designed to be invoked and then one will live in it until the end of his session. While vi is designed to be invoked as needed.

But on today's computer, emacs usually is also super fast, whether their invocation, opening files or when processing something.

I understand that emacs is not following Unix philosophy at all.

But in a sense, emacs is nothing but elisp interpreter with some addition to aid text editing.

All of those elisp packages are not emacs. They are just elisp packages, running on emacs. And those elisp packages usually are highly specialized tools.

I understand composability means each tools can be combined to build a more complex solution, such as through piping and redirection.

In a sense, elisp packages are just functions. We can use them in our own elisp code. But I know, it is different with the Unix composability.

#GNUEmacs #Emacs

@weavejester

@restorante Unfortunately I haven't been able to get Emacs to run super fast, even on modern machines - and I've tried both MacOS and Linux.

While I've used Spacemacs for years and love it, its relative sluggishness has been a real annoyance, and probably the biggest factor in why I keep looking for alternatives.

@weavejester It is just a matter of configuration. I've built my config from scratch, never trust any frameworks. I can check and debug any bottlenecks and defer them using use-package. My #Emacs is starting less than second and I can't see big difference between it and #Vim , except vim is very limited and can do only 10% of what #Emacs is capable of.
@crandel @weavejester When you say you don't trust frameworks, do you mean things like Space/Doom?
@mgd @weavejester Yes, and the same from vim side too.
@crandel @weavejester thank you, I thought you meant packages. I use Vanilla Emacs and am trying to make use of in-built packages over external ones

@crandel It's certainly something to do with the packages I have installed. Before I used Spacemacs I used a custom configuration, but it wasn't appreciably faster.

I'm sure vanilla Emacs runs much quicker, but if I want the functionality those packages provide, that doesn't help me much.

@weavejester No, that's wrong assumptions. Vanilla #Emacs is not faster than Spacemacs or Doom. But you can configure it to be using defer and autoloading. I put some time and effort on it and defer most of the packages, as they could be loaded later, only when they are needed. You can find some inspiration here

https://github.com/Crandel/home/tree/master/.config/emacs

home/.config/emacs at master · Crandel/home

my linux home settings. Contribute to Crandel/home development by creating an account on GitHub.

GitHub

@crandel But that would only affect startup though, right? I don't have any issue with startup time, as I run Emacs in server mode that boots up when I log in. Opening a new Emacs client is instant.

My problem is more general sluggishness and performance hitches, particularly when editing larger files.

@weavejester It is highly depends on your setup and files you are working on. For really big files I use vim too. But for regular software development in #GoLang with gopls as lsp server I have no issues at all. But I heard lsp server for #Python could be very slow.

@restorante @demiguru @weavejester

Vi isn't composable either. Sed and Ed and awk are composable.

That argument is out of context when talking about things with user interfaces.

I would say that emacs is ultimately more composable than vi, vim, or neovim. Emacs can integrate easily with other systems and tools.

That's the thing that it does amazingly well. Just because it's a super power doesn't mean that it's not within the philosophy.

The extensibility of #Emacs through integration with other tools is off the charts. That to me is completely within the Unix philosophy. I've been a Unix dev for 45 years. I think I know.

@Zenie @restorante @weavejester The claim that #Emacs is “more composable” than vi/#vim/neovim rests on stretching the meaning of composability. What Unix traditionally meant by composability was the ability to take simple, single-purpose tools and connect them together via well-defined interfaces (stdin/stdout, pipes, files). By that definition, ed, sed, and awk are indeed composable—they were designed to slot into pipelines without friction.

@Zenie @restorante @weavejester Vi (and later vim/neovim) may not fit that classical mold perfectly, but they do adhere to it in a limited way:

They operate directly on plain text files (not opaque binary state).
They can be scripted through ex commands.
They can be invoked non-interactively to perform transformations (vi -es).

That’s composability in the Unix sense: predictable input/output behavior and scriptable interfaces.

@Zenie @restorante @weavejester Emacs, on the other hand, is extensible, but extensibility is not the same as composability. Extensibility often means pulling other tools into Emacs, wrapping them in Lisp, and effectively making Emacs the hub of everything.
@Zenie @restorante @weavejester That’s closer to integration or even absorption, not composition. You don’t pipe the output of grep into Emacs and get a text transformation out the other side—you embed grep within Emacs as a Lisp function call.

@Zenie @restorante @weavejester That’s philosophically different.

Vim is composable in the Unix tradition because it’s file-centric, scriptable, and plays in pipelines.
Emacs is extensible and integrative, but its model of absorbing everything into itself arguably violates the spirit of “do one thing well.”

In other words, if we’re being strict about Unix philosophy, Emacs is powerful, but it’s less “composable” than vim—it’s more of an operating system in itself.

@demiguru

I am not an expert of elisp. But may be you are interested to:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Command-Example.html

echo "Hello World" | emacs --batch --eval '(progn (insert (read-from-minibuffer "Input: ")) (write-region (point-min) (point-max) "output.txt"))'

I just simply copy paste the code above

@Zenie @weavejester

Command Example (GNU Emacs Manual)

Command Example (GNU Emacs Manual)

@restorante @Zenie @weavejester

What you’ve shown is Emacs scripting, which is fine, but it’s internal extensibility — you’re writing Emacs Lisp that runs inside Emacs. That’s not the same as taking existing Unix tools and composing them through standard input/output.

In your example: echo "Hello World" | emacs --batch --eval '…'

@restorante @Zenie @weavejester

Notice that echo isn’t actually feeding data through stdin to Emacs in a composable pipeline — instead Emacs is prompting and inserting via Elisp. Compare that to: echo "Hello World" | sed 's/World/Unix/'

@restorante @Zenie @weavejester echo "Hello World" | awk '{ print toupper($0) }'

Here, the tools are directly transforming streams, no custom scripting language needed.

@restorante @Zenie @weavejester The key distinction:

Composability in Unix = tools designed to chain together seamlessly via text streams.
Extensibility in Emacs = embedding custom code inside a monolithic program to mimic composability.
So your example sort of proves the point: Emacs can simulate composability, but only by turning into its own runtime and requiring Elisp knowledge. That’s integration by absorption, not “do one thing well.”

@demiguru

Well, perhaps emacs is exactly a tool to run elisp code. May be, when we use Org Mode, we do not really use emacs, but Org Mode. It is Org Mode that using emacs.

That is one of the reason I wrote emacs is different with the Unix philosophy.

#GNUEmacs #Emacs

@Zenie @weavejester

@restorante @Zenie @weavejester
I get it — Emacs is a Lisp machine and modes like Org build on top of that. That’s exactly why it sits outside the Unix philosophy.

Unix composability is about chaining small tools with stdin/out. Emacs is extensibility through Elisp. Both are powerful, but by your own framing, Emacs isn’t Unix-composable — it’s a different philosophy altogether.

@demiguru

Yes, indeed Unix philosophy and Lisp are two different ways of life.

Ability to edit the code of the programs we are using and then reload it. Or having the whole systems as a gigantic set of Lisp libraries which we can use it in our own Lisp code.

Yes, these way of life is vastly different with Unix philosophy.

#Unix #Lisp

@Zenie @weavejester

@restorante @Zenie @weavejester GNU means GNU is not UNIX. The main point was free software and less a special philosophy. ok let's make it clear: nvim is cli-world and emacs is lisp-land.

@superketchup

Yes, I agree totally that GNU is all about freedom. It is a social movement, just happening in the field of software.

I think, discussing GNU Emacs as a piece of free software (libre software) or as a lisp programming environment or as an editing system is okay and fruitful.

GNU Emacs is such a wonderful and magnificent piece of software afterall.

#GNU #GNUEmacs #Emacs

@Zenie @weavejester

@restorante @Zenie @weavejester Exactly, in the beginning I also thought GNU would be an art open source unix. -> False. It has its own philosophy and Emacs is a central component of it. This is about Lisp machines and their universality. These people want to write more than utility programs for the console. 👍

@demiguru Emacs is an editor. GNU Emacs is a "Lisp Machine".

People make this mistake to confuse Emacs the Editor and GNU Emacs which implements a version of Emacs, plus lots more things.

@restorante @[email protected] @weavejester

@demiguru In Emacs the composability is done from the Lisp side, where you "chain together seamlessly objects".

At the end of the day Emacs is just an editor like vi, vi is not composable, neither is ed. The difference is that Emacs and other parts of the system can share code -- on Unix this is impossible (vi cannot share the implementation of g/RE/p with e.g grep -- in Lisp you can).

@restorante @[email protected] @weavejester

@demiguru @restorante @Zenie @weavejester no custom scripting language but the shell, which can be tcsh, sh, ksh, bash, fish, zsh, or scsh…

The differentiator is the process boundary between the components, and text stream as the only interchange data true. Emacs also uses sub-processes and their stdin/out like a shell would. One could argue it’s a shell with a better language and data types then the previously mentioned shells, and buffer abstraction to handle the text in and out of a process

I think your being a bit flippant in calling structured composition of data and functions a mimicry of composition.

I enjoy vi, helix, emacs and all those shells with the exception of t/csh — which is for people of no account anyways.

@craigbro @restorante @Zenie @weavejester
#Emacs can spawn subprocesses, sure — but most of its “composition” happens inside the Lisp runtime.

#Unix composability is black-box tools chaining via text streams across process boundaries. Emacs is powerful, just a different model of composition.

@demiguru @restorante @Zenie @weavejester awk or sed is your scripting language in that case (much simpler and more limited than emacs lisp but still). 's/World/Unix' is your script, and you could write that to a file, use more complex or multiple commands etc. With emacs you can achieve the same thing and make it more composable by making a few adjustments to the example above:

@demiguru @restorante @Zenie @weavejester

echo "Hello World" | emacs --batch --eval '(progn (insert (read-from-minibuffer "")) (princ (string-replace "World" "Unix" (buffer-string))))'

This does the same as 's/World/Unix/' in sed and prints it again to standard output. It's not that #emacs is not composable like that, but that it's usually used interactively (because that's more fun).

@demiguru @restorante @Zenie @weavejester also, I think of #emacs more like a universal interface to your computer, the command line, all the tools you call etc. And in that sense I would interpret the unix philosophy a bit differently: the individual tools, whether that's a command line program or a lisp function, should do one thing well and be composable, but IMO it doesn't matter if you pipe them together on the command line or you combine them within emacs.

@eruwero
I get that view — #Emacs can feel like a universal interface to the system, and its #Lisp functions are composable in their own right.

Where I see the #Unix philosophy diverge is in the boundary: tools designed as separate executables, with contracts enforced by the #OS, versus composition inside a single runtime. Both routes achieve interoperability, but one leans on external guarantees, the other on internal extensibility.

@restorante @Zenie @weavejester

@demiguru @restorante @Zenie @weavejester IMO this internal/external distinction is relatively arbitrary. In one case you have "separate executables" that you call from a shell, which is equivalent to calling a function, with the shell being the interpreter. In the other case you have lisp functions and a lisp interpreter (emacs) to call them.
@eruwero @restorante @Zenie @weavejester Right, that’s the analogy I was pointing at — a #shell is an interpreter, processes are its “functions.”
The key difference is that in the #Unix model, the #OS enforces the separation: each process is isolated, communicates through defined streams, and can be swapped out independently. In #Emacs, #Lisp functions share one runtime. Both are composable, but the guarantees differ.

@demiguru @restorante @Zenie @weavejester ok I get your point. I still prefer the lisp machine/emacs approach were there are as few arbitrary boundaries as possible and everything can be modified dynamically, but that's a philosophical issue :)

What I still don't get is how vi/vim/neovim better fits into this unix model because you use it in a similar way as emacs, you usually don't use it in some pipeline in the shell, even if you could do that. So AFAIU they are equivalent wrt that

@eruwero @[email protected] @Zenie @weavejester Fair point — in practice, most people don’t drop Vim/Neovim into pipelines either. The distinction isn’t about what users *typically* do, but what the tools were designed around.
#Vim/#Neovim operate directly on text files and expose transformations that can be invoked non-interactively (`-es`, ex commands, reading/writing from stdin/out).
@eruwero @restorante @Zenie @weavejester That puts them closer to the #Unix “small tool + text stream” model, even if most use is interactive.
#Emacs can absolutely script and integrate too, but its defaults lean toward internal composition inside #Lisp. Different defaults, different traditions — even if in day-to-day use they both feel like editors first.
@demiguru @eruwero @restorante @Zenie @weavejester for me this sounds not GNU Emacs specific. Most/many Lisp implementations on UNIX will work that way: code & data are shared in a single address space and provide a resident programming system.
@demiguru @eruwero @restorante @Zenie @weavejester the typical Lisp Machine then had only one Lisp runtime with one address space, booted as the operating system
@symbolics @eruwero @restorante @Zenie @weavejester Right — and that’s why I see #Emacs as #Lisp-lineage first, #Unix-lineage second.
@Zach  🇮🇱 🇺🇸

I think you're basically correct to point out that Emacs does not adhere to the unix philosophy as it is classically understood.

The locus classicus is presumably the widely quoted McIlroy et. al. in the 'Unix Time-Sharing System" where Emacs clearly violates the first maxim:

Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features."

Or to take a later articulation, Gancarz in Linux and the Unix Philosophy's first two tenets: 'Small is Beautiful', 'Each Program Does One Thing Well'  — again Emacs is the opposite of this.

(This kind of thing comes up constantly in every mention of the Unix philosophy that I've ever seen until this conversation and is easily verified by simply searching.  It's strange to see people insisting that there is simply no emphasis on small, special purpose programs. Of course one can decide that principle isn't important, but let's not ignore that it was (and I believe usually still is) considered to be so)

We can also note that in the original incarnation of Unix ('Research Unix') there was nothing remotely like emacs and there was, as far as I know, very little scriptability.  The Thompson shell allowed for piping but not scripting.  OG unix is everything is written in C, with a simple interactive shell and if you want anything else it's back to C programming.

Whereas Emacs does (as you say) have more in common with the Lisp ethos, where there aren't separate programs per se and everything is a function in one giant Lisp environment (same is true of Smalltalk) — although there are differences there, too which I might get on to later.

I think it pays to note that these views are informed by very different language traditions.  C is a static language with an explicit and slow compilation step.  Lisp on the other hand has always been a dynamic language where you can just throw a new function into your environment pretty much immediately, usually without having to (explicitly) compile or restart anything.

If you think about it a bit you might start to see that if all you've got is C, small programs that don't keep their own state but write to text files may be the simplest option for getting any composibility, particularly on limited machines.

However, I think we can fairly say that Unix found that only having a statically compiled language available was far too limiting and early on started haltingly down a path to acquiring dynamic programming abilities, starting with scriptable shells, and later larger programs with their own scripting languages.

People often cite the Unix philosophy as though it's obviously the right way to program.  Modularity, clear interfaces, and composibilty we all think are good things, of course.  But why is 'one program does one thing' better - or even equal to - 'one function does one thing'?

#emacs #lisp #unix
Zotum

@demiguru

The code example above is intended to be run on a shell. It invokes echo and pipe the output to emacs.

Emacs processes the input (echo's output) and creates the output.txt.

Option -batch means using emacs non interactively while option -eval is to evaluates elisp code.

Again, I am just a casual user. I am not in any way an elisp expert. Please correct me if I am wrong.

@Zenie @weavejester

@restorante @Zenie @weavejester
sed and awk take stdin → stdout, so they compose cleanly in pipelines.

Your Emacs example isn’t really doing that — your code runs Elisp that prompts for input and writes to a file. That shows your extensibility, not your composability.

Composability is about external contracts (stdin/out), not embedding everything into your Lisp runtime.

@restorante @Zenie @weavejester
You did run it from the command line, sure. But running from the shell isn’t the same thing as behaving like a composable Unix tool.
@restorante @Zenie @weavejester
Your Emacs command didn’t actually consume the echo output as stdin and pass a transformed stream back to stdout. Instead, your code dropped into Elisp, prompted for input, and wrote to a file. That’s extensibility inside your runtime, not composability between independent tools.
@restorante @Zenie @weavejester
Composability is about chaining external processes with stdin/out — not embedding an interpreter into one big program.

@demiguru

Ah yes you are right. There us (read-from-minibuffer "input: ") which means waiting for input from minibuffer.

Sorry, I didn't really read and run the code. I just copied and pasted it from the Internet.

@Zenie @weavejester

@restorante @Zenie @weavejester
All good 👍 That actually makes the point clear: sed/awk compose through stdin/out, while Emacs extends itself through Elisp. Two powerful models, just different philosophies.
@demiguru @restorante @Zenie @weavejester This is not an argument at all. Elisp is exactly the same as sed/awk scripting language. And still nothing even close from #Vim side

@crandel @restorante @Zenie @weavejester sed and awk are Unix tools first — they compose through stdin/out, and their scripting just extends that model.

#Elisp only runs inside #Emacs, which makes it extensibility inside a runtime, not Unix-style composability. #Vim is more limited, but #Neovim adds real extensibility while still keeping to the file-centric #Unix model.

@demiguru @restorante @Zenie @weavejester Vim has nothing to do with Unix philosophy at all

@crandel @restorante @Zenie @weavejester

#Vim may not have been part of early #Unix, but it does embody a Unix-like approach: file-centric, scriptable, and able to operate in pipelines (vi -es). That aligns with composability more than #Emacs’s “Lisp machine” model.

@demiguru @restorante @Zenie @weavejester No, vim has nothing to do with Unix at all. This is a false argument.
@crandel @demiguru @restorante @Zenie @weavejester Presumably neither do other visual QED lineage editors like sam and acme. Who cares that vi is just an interactive mode of a barely enhanced form of ed, or that DMR wrote an essay about the QED editors mostly because of vi’s popularity, or that vim’s visual addressing is as obviously an enhancement upon ken’s QED regexp addressing as ken’s was upon the original QED. What do joy, dmr and ken know about unix philosophy, anyway.
@josephholsten @crandel @restorante @Zenie @weavejester
The history’s fun, but the real question isn’t ancestry — it’s whether a tool fits #Unix composability. That distinction still matters.

@demiguru @crandel @restorante @Zenie @weavejester Ah, you’re right. Ed clearly is a foreign tool to the true unix philosophy.

It wasn’t until the mid seventies that sed finally allowed dmr and ken to learn what it meant to be Unix, huh? Except shoot, that wasn’t from either of them. Nor were pipes in shells until after the last Thompson shell. I guess neither of them really understood Unix at all.

@demiguru @crandel @restorante @Zenie @weavejester Really, the true origin of the unix philosophy was obviously TECO on Multics, https://web.archive.org/web/20000819071104/http%3A//www.multicians.org/mepap.html

What had more powerfully files than Multics or more composability than TECO?

Multics Emacs History/Design/Implementation

Classic paper describing thie history and design of Multics Emacs.