140 points · by oumua_don17 · 2y ago · 153 comments
My advice to people when editor wars come up is that going deep on something is more important than going deep on the right thing. emacs versus vi? No strong opinion. I happened to learn emacs first and would be repeating a lot of labor to go as deep on vi.
(... But I do tend to give a slight nudge in the direction of something of that ilk because relative to say, VS code... Those editors have already stood the test of time, they aren't beholden to one owner, and while past performance is not proof of future expectations, there's a lot of people heavily invested in keeping both of them alive and thriving).
Speaking as someone who used vim for 10 years before getting sniped by Emacs (ten years ago.. shit I'm getting old):
vim isn't as deep as Emacs, it's not even close. vim is only as deep as evil-mode. In fact, vim has a UX paradigm that's out-of-the-ordinary, and that's it.
That's why in Emacs, modal editing is just another minor mode..
https://lem-project.github.io/ https://github.com/lem-project/lem
I really, really want a graphical emacs. By that I mean, I want an emacs with graphics, not an emacs in windows. I want to easily be able to draw stuff.
I ran into this the other day, I like to dabble in emacs, and I had a list of results I wanted to make a quick chart. I ended up dumping it out in a simple CSV, and copy/pasting that into a spreadsheet, and hitting "chart".
Would have been nice to go (line-chart my-list) and have a window pop up with reasonable defaults. And be able to print it to a PDF.
emacs has some SVG support, but I guess its maintainer whim whether you get it or not, I wasn't able to easily get it working on my Mac. That could be a start. But something "nicer" would be, you know, "nice".
https://sqrtminusone.xyz/posts/2021-05-01-org-python/
(the very first screenshot is Emacs)
But the issue of non-GPL software is the person on the receiving end might want to contribute, be technically able to contribute and indeed need to contribute to be able to keep using the software ... but then be blocked for legal reasons. The GPL doesn't care if you sell software or give it away or whatever, it is all about protecting freedom over time after the initial installation has happened.
The thing that makes the ice cream analogy ok is that the ice cream is literally synthesised into your body and comes under your complete control. If the ice-cream seller retained any sort of control over the ice cream after you'd ingested it that would be a serious problem! Both technically and morally. The GPL is aligning what happens in software to the analogy.
I can. The guy giving away the ice cream is destroying the market. You can't compete against free. If programmers would stop surrendering their labor, personal data resellers like Google and Facebook wouldn't be our primary means of making a comfortable living. Say what you will about Microsoft's monopoly in the 90s. At least they took your money with your eyes open.
The irony of course is free software zealots are pissed at the free ice cream guy for completely different, and I agree with you, utterly stupid reasons.
Licences like GPL optimise community freedom: they give each user the freedom to do anything except restricting the freedom of others.
Think of it like local vs global optimisation.
But so many of the things I now rely on -- company mode, treemacs, vertico, etc. are not there. The value in Emacs is the huge community of things.
Also I had some instability each time I tried it -- buffers filling up with Common Lisp backtraces, etc.
Still I really want to see some advancement in this arena, because the actual implementation of GNU emacs leaves a lot to be desired in 2024. The packages overtop of it are nice, but the core editor blocks and pauses too much.
try C-x d aka M-x filer?
Useful though.
[1] https://web.archive.org/web/20221002093520/https://groups.go...
[2] https://web.archive.org/web/20210407151341/https://discuss.a...
The Deuce Editor Architecture (2014) - https://news.ycombinator.com/item?id=40117075 - April 2024 (6 comments)
The good things: editing works, slime works, access to all my Quicklisp based libraries and projects. The bad things mostly involve limited Lem functionality because I rely on many eLisp libraries like treemacs, etc.
I really like the speed, and having everything in Common Lisp is fun. I was using Roswell to build Lem from source, and I really liked the project’s setup, build process.
Try C-x d in Lem (Alt-x filer) https://lem-project.github.io/usage/usage/#filer---project-e...
Building the sdl2 version, there is no luck finding libSDL2_ttf, so I'll be trying the ncurses version.
Looks pretty snappy so far.
I only know that because when using Emacs on the Steam Deck using the menu bar is a little easier than doing input using Hacker Keyboard on my phone passed to the Deck using KDE Connect.
- Rune (https://github.com/CeleritasCelery/rune) - A re-implementation of Emacs but in Rust (like Remacs, but actively developed)
- Pimacs (https://github.com/federicotdn/pimacs) - Same, but using Go (created by me, but developed in a very slow pace)
Although I wish they’d explore the Kakoune/Helix style of editing too, which I think will become a major competitor to Vim (and I personally prefer it myself).
However, I am also worried that Lem won’t gain any traction because the Emacs ecosystem is just too vast and has too many killer apps (Magit, OrgMode, Dired, the amazing built-in Help/Documentation - to name a few).
But it may very well become a modern Emacs alternative if they focus on better user experience, leave behind some idiosyncrasies of the past and create great alternatives or ports of Emacs’s most appreciated plugins. There is a great opportunity in starting from scratch, but I guess it is also a huge challenge to compete against decades of development, a huge community and a rich ecosystem.
Lem has a wip Git mode: see status, stage files/hunks, commit, interactive rebase, basic hg and fossil support. (I added it)
It's WIP and undocumented yet (don't worry I'll document when ready, I love documentation ;) ) Use
M-x lisp-eval-string RET (ql:quickload :lem/legit)
then M-x legit-status or C-x g
> DiredLem has a directory mode with some actions: sort (name, mtime, size), mark by regexp, rename, delete, find files…)
I'd hope that a fresh emacs from scratch would just ship with something close to what those provide.
In the end my biggest beef with emacs these days is just the terrible lack of multithreading, bringing long pause and startup times. Most of my problems in the past have been rectified. Emacs 29 is really quite delightful and much easier to manage than ever before.
Lem has a LSP system,
something like projectile (M-x project-find-file, M-x project-switch etc, still inferior but nearly there and easy to extend)
images: yes (the SDL2 version). It can display games (M-x tetris, it can run a real game engine)
evil: great vim layer, no leader key. I didn't see a discussion about that, you should come and ask ;)
and no:
GUI buttons: that's not a UI choice I guess, so no
no org-mode support yet, although it has an Emacs RPC, so the idea is to use it to bring org-mode.
not asked, but good to know:
it has a wip Git mode: see status, stage files/hunks, commit, interactive rebase, basic hg and fossil support. (I added it)
Of course, it could be a foundation to build on, I dunno.
EDIT: yes after watching the presentation, it has a modal/vi type mode
https://sachachua.com/blog/2024/01/2024-01-28-yay-emacs-clos...
What he probably meant, that GNU Emacs (1984-...) was based on the code of another Emacs implementation, Gosling Emacs, which also had a commercial version.
The original EMACS was developed at MIT, 1976, by Guy L. Steele Jr. and David Moon.
If it's just because hacking is fun, then by all means have a blast. But if the goal is to compete with Emacs, consider instead setting the target at something with far greater popularity than Emacs.
Worth noting is that LSP came from Microsoft as part of their efforts to build a better editor experience; and its integration with VSCode is largely unparalleled.
For example: in VSCode the user doesn't have to understand how to install a language server, it just automagically suggests allowing it to install one for you. In Emacs, if you're using the official distribution you will have eglot, whose developers specifically refuse to add that functionality. If you're savvy enough you can install lsp-mode and it will add that functionality, but at that point you may as well just install the language server yourself.
And about magit: it's a beautiful piece of software, it truly is. It's also hot garbage with large repositories hosted on Windows. I simply cannot use it for work because every operation takes around a minute to resolve, which locks up Emacs entirely. Again, here VSCode shines because the default git integration is pretty good, and there are extensions that make it excellent.
For these reasons, and more, I always recommend VSCode to new developers and don't recommend Emacs. Emacs is for people who want to make editor customization a _hobby_.
I can understand this not being friendly for some users, but on most systems that people are using Emacs on, software is installed through a system package manager and not downloaded and unpacked into ${HOME}. I do not want software that isn't the system package manager to install LSP servers.
Maybe this is more of an issue for people using Emacs on Windows, since there is no system package manager, and people are less likely to understand how to install stuff.
Earlier today I started up emacs in a C++ project after working exclusively in Rust, and I didn't have an lsp server for C++ installed. I did M-x lsp-mode and it prompted me (paraphrased): No language server for C++ installed, do you want me to go get one for you? Options are: clangd. Sure, said I, and it just went and installed it and off I went.
Granted, you'll also need company-mode and stuff, yes. And to get an IDE like experience... treemacs, projectile, etc. etc.
Yes, it's an acquired taste. But it's not like it's obsolete. It's better and more active than it's ever been. And I've been using Emacs (mostly casually) since 1992.
I disagree. I use it for org mode to take notes, track time, and write documentation. I use it with SLIME to program in Common Lisp (side projects, though). I make changes to .emacs or write an elisp function once in a while, usually to finesse something that I do frequently, but it's definitely not a hobby. It's a great tool, even before any customizations, IMO.
Maybe if I were a professional web developer, I would be able to modify vscode in the ways I feel it needs to be modified to support my personal style after a reasonable investment in learning vscode internals, but that is manifestly not actually the case.
BTW, I don't use and don't like org mode.
And Emacs will still be around.
Many (most?) Emacs enthusiasts don't use it primarily for SW development. VSCode simply isn't an alternative for their needs.
Make two lists:
- List of things you can do in VSCode that you can't in Emacs
- List of things you can do in Emacs that you can't in VSCode
The latter list will be 10-100x longer.
And on top of all that the actual core editor is, once you get your fingers wrapped around it, just... the best. It can do so many things that other editors just don't do, it's responsive and fast, the buffer metaphor it works with is great (so easy to have the same file open in multiple windows at different regions, it's beautiful) and I love the tiling system for its frames, etc. etc.
In 30 years, we'll still be using Emacs, but VSCode will have moved on.
- Read and reply to my emails?
- Manage TODOs across domains (so e.g. I can make a TODO that has a link to a specific email)?
- Use it as a Mastodon client (read and write toots, boost them, favorite them, etc)
- Scrape a web site (several pages), getting only the relevant content[1]
- Bulk rename/copy lots of files with a custom naming algorithm
- Chat on IRC
- Use it as a spreadsheet
- Do numerical integration with it
- Have a literate document with code in several languages that talk to one another
- Annotate PDFs
This is a tiny list. In fact, you can browse past Emacsconf talks to see how people use it.
[1] https://blog.nawaz.org/posts/2023/Mar/solving-a-scraping-pro...
https://code.visualstudio.com/api/get-started/your-first-ext...
That's the VS Code description on how to start writing extensions to VS Code. The first steps involve installing node.js so you can install another tool so you can generate scaffolding.
In emacs it would be:
Step 1: Open emacs
Step 2: Open a scratch buffer (q&d extensions, put in a .el file if you want to preserve it)
Step 3: Write some lisp code
Step 4: Evaluate the lisp code
Step 5: There is no step 5, use your extension
Caveats:
You have to learn programming to extend either of them so that's a common burden.
You have to learn lisp to extend emacs, but that's an easy thing to do.
You have to read the documentation to really get going with extension development, another common burden.
In VSCode, I don't think there's anything like "place code in this file, run it at startup, and code within this file can be present/applicable everywhere". Maybe you could do something as a plugin, but that is a big lift compared to Emacs.
For example, think about doing a "Hello World".
In Emacs, you just open init.el and place `(message "Hello World!")`.
In VSCode, you have to follow a whole set up for an extension [0].
[0]: https://code.visualstudio.com/api/get-started/your-first-ext...
What does that even mean? Both editors have large&strong communities. I don't see them going anywhere.
I'm pretty sure the authors of NeoVim heard wise advice like yours, but I'm happy they continued.
I dream about a day when programmers stop being fervent zealots about tools they use and instead try to find pros and cons of their tools and try to borrow good ideas from each other.
This 'Emacs vs. Vim vs. VSCode, etc. etc.' comes from poor understanding the core principles of each of these things.
Can we discuss these things without emotional attachment, or even forget for a minute that they are "editors". Instead of trying to find who's wining "the editor wars" (is it even a thing?), can we instead talk about the big ideas behind them?
- What makes Emacs so powerful for many, and at the same time so intolerable by many others? The big idea behind Emacs is Lisp. Without understanding the core principles of Lisp, and by "understanding" I mean truly experiencing the dynamic nature of it, its malleability, the structural editing, 'true REPL', 'code is data', etc., it is quite pointless to even start such a discourse.
Lisp is amazing. I firmly believe that every programmer should gain good familiarity with Lisp. I am forever indebted to my younger self for forcing myself to learn Emacs and Emacs Lisp and for discovering the beauty of it. Learning Lisp made me a better programmer. I'm not claiming to be a good programmer today, but I was much worse before I learned Lisp. Lisp helped me understand FP, composability, meta-programming, logic, recursion, lambda calculus, symbolic computation, generative testing, and even type theory. And I'm quite sure, many other programmers can share the same sentiment.
- Without understanding, I mean not just "understanding", but heartfelt use of it for many months and maybe even years of the fantastic, remarkable idea behind modality and mnemonics of Vim, it is quite impossible to explain what makes it irreplaceable for those who learned its power. And by the way, there's no such thing as vim-mode. No other editor or IDE truly was able to recreate that model, with one exception - Emacs. None of the IDEs - IntelliJ, VSCode, XCode, Android Studio, etc., can properly emulate Vim-navigation. Only Emacs does a better way of vimming. Pretty much every other IDE fails to replicate Vim. Unless it's Vim/Neovim, vim-mode in all of them is just that - an emulation. However, Evil mode in Emacs feels much more natural. Sometimes, you forget that it's an afterthought, an extension, and not a built-in functionality. And that's due to the power of Lisp. Also, these days, there's ton of interesting stuff getting build on top of Neovim, because now you can use Lua instead of vimscript. And with Fennel - a Lisp that compiles to Lua, one can build some really interesting extensions.
- Now, VSCode fancies the idea of being built on top of a web browser engine. Turns out, it ain't such a bad idea after all. Perhaps Vim and Emacs should also one day try to have their own, built-in web browsers. I mean truly built-in, so one can extend it and change it and build things on top of it.
I guess, it turns out there's no such thing as "editor wars". VSCode is more popular today because certain ideas behind it make it appealing for many people. For the same reason, certain ideas make Vim and Emacs more appealing for others.
Yes, you can use emacsclient, but that's a bit of a different thing and has its own disadvantages.