Emacs fulfills the UNIX Philosophy

Home About GitHub

Part 1: Emacs is an app platform

This is part 1 of a 6-part series of articles defining what the UNIX philosophy is, what Emacs is, and discussing whether Emacs fulfills the UNIX philosophy.
0. Introduction
1. Emacs is an app platform
2. What is the UNIX philosophy
3. Seems like Functional Programming
4. Lisp does FP better than UNIX shell programming
5. The parallel histories of UNIX and Lisp
6. Response to common criticisms

Emacs does not have extensions, it has apps

There is one argument that I have got very tired of hearing, which goes something like this:

If the UNIX Philosophy is that every prorogram does one thing, and does it well, then Emacs is the opposite of that. It is a text editing program that tries to do everything. It has extensions for being an e-mail client and web client, for playing music, for managing Git branches, even for playing Tetris. Who needs a text editor with that much bloat? Emacs may as well be an operating system, not an editor.

There are two problems with this argument:

  1. Emacs is not a text editor, it is an interactive Lisp runtime environment, i.e. it is a programming language. Emacs really does do just one thing, and does it well: it runs Lisp programs.

  2. Most of those extensions, except maybe Tetris, are not bloat, they are Lisp packages, or apps if you will, that run in the Emacs runtime. (Well, some people actually kind of need Tetris.) Most other programming languages you install will come with a selection of useful packages along with it — maybe even Tetris if perhaps it is designed for programming games. And like Python's PIP, Perl's CPAN, Ruby's Gem, Node's NPM, Rust's Cargo, Haskell's Cabal, and Common Lisp's QuickLisp, Emacs does have it's own package manager and package repository as well, called ELPA.

The Emacs text editor is also an app

The text editor in Emacs is just another one of the pre-installed Lisp packages. The text editor happens to be the first thing you see when you run Emacs with a file as an argument, so it is understandable that people confuse Emacs with an ordinary text editor.

So I think it is better to define Emacs not as an editor, but as a Lisp app platform. It can be thought of as analogous to how the World Wide Web is a JavaScript app platform, or Microsoft's .NET is a C# app platform. Emacs is not an OS, but it is easy to see why an app platform might be confused for an OS — OSs and app platforms do share a lot in common. On small platforms like smartphones and tablets, the OS and app platform are indistinguishable, even on Android OS which uses the Linux kernel.

Emacs Lisp is a powerful programming language

I also think Emacs Lisp is a pretty powerful language in it's own right, as most languages in the Lisp family are. Lisp programs running in Emacs can be much more composable than other programs in the UNIX Programming Environment. One reason for this is that Lisp is a proper functional programming (FP) language, while the Bourne shell family of languages are not, as I will try to explain in part 3 of this series. Emacs also provides APIs for running POSIX processes, so Emacs can act as a shell just as well or better than Bash can.

Although Emacs is most effective if used as an interactive Lisp programming environment, some people I know of do use Emacs as just a text editor, and often it is because they are most familiar with the key bindings. People in this camp could care less about Lisp or any of the other Emacs apps. For people who use Emacs in this way, I would recommend using a lighter-weight text editor like Jed, Jove, MG, Zile, or e3em. Honestly though, I don't think the key bindings are Emacs's greatest strength. In my opinion, there is little purpose in using an Emacs-like editor unless you really just love the key bindings. The true strength of GNU Emacs is it's app ecosystem.

Conclusions

This was a very short article that I hope dispenses with the biggest misconception of Emacs, at least in my experiences talking about it with peers. I hope we can agree from the beginning that we should define Emacs not as a text editor, but as an app platform for which apps are programmed in a dialect of the Lisp programming language. But I have only breifly discussed here how this relates to the UNIX philosophy, so this is what I will talk about at length next time, in part 2 of this series.