183 points · by todsacerdoti · 5y ago · 84 comments
Like everyone, I’m finding that I’m in an increasingly disparate set of tools with diverging interface design choices to get my jobs done. The cognitive dissonance that all these different interfaces presents me with feels like it’s getting out of hand, and is growing non-linearly.
Emacs is a arcane tool, and is dated in so many ways, but I don’t know that I can find another solution that allows me to counter the ever-growing complexity of software productivity solutions that I presented with both in my personal and professional life. I know I’m not alone.
As someone who’s not a developer nor a full-time product person, (actually a doctor that wandered into tech), I often wonder why I can’t choose my own front end, and why am forced to use interfaces that don’t work very well for me. Emacs helps me escape some of that (at the cost of a huge relative learning curve, granted)
Emacs was famously used by “secretaries” (as they were referred to in those days) not only to write documents and mail but to write macros to make their lives simpler. Of course none of them could “program” (which was considered quite intimidating) but they didn’t consider writing Emacs macros to be “programming”.
Back then Emacs was written in TECO so writing actual libraries was pretty arcane and not as easy as it is today.
But I’m glad the learned helplessness around programming has largely ablated, in part through improved tools and in part through simple acceptance.
As a law student in 1980-81, I wrote a custom user manual for the law review editors and our admin to use Emacs and Brian Reid's Scribe formatter (on the Computer Science Department's TOPS-20 machine using a VT-100 terminal over a 9600 bps line). I was the only even-remotely technical person on the editorial board, but even so, we were all in heaven: Once manuscripts were typed into Emacs / Scribe by our admin, we didn't have to literally cut, paste, hand-mark, retype, etc., on paper as the editing process progressed. And it speeded up the production process because we sent "clean" edited manuscripts to the printer, as opposed to manuscripts with significant pen-and-ink proofreader marks; this dramatically reduced the time we spent reading and correcting galley proofs. (Electronic transmission to the printer was next on the experiment list but we graduated and left.) I'm sure that's why I've been an Emacs user ever since, and wrote keyboard emulators for WordPerfect and MS Word.
But its very possible -- I never interacted with any non-programmer Multics users.
But there was a time when interfaces were unified, sometimes to an absurd level (e.g. applications having a File menu when they had nothing to do with files) but IMO that is still better than every app being its own thing.
The rise of electron as an 'acceptable' (to some people) substitute for platform-native applications and the myth of the possibility of the "cross platform UI" has accelerated this, really. It's quite unfortunate.
I haven't paid much attention to the Electron world myself so I don't know to what extent anybody is taking advantage of this, but even if they're not, I expect it would be easier than with alternatives.
If this year's Emacsconf is anything like the last one, you are a good candidate for watching/attending it. I know whenever Emacs is brought up on HN inevitable comparisons with IDEs and VSCode are made, but if you browse last year's talks, you'll see that most talks are not related to SW development. Emacs has a lot of enthusiasts who like it not for SW development but as an ecosystem.
I've used it on both Linux and macOS; for whatever reason, my Emacs has always been snappier on my Linux machine, and that's still true with native compilation, but now the macOS experience is also pretty solid.
Actually, can I convince you to share your experience and submit a talk proposal? User stories were a well-received part of EmacsConf last year, and lots of people liked Pierce Wang's talk on learning Emacs as a high school student who's passionate about music. I think people would love to hear about how you wandered in, how you climbed up that learning curve, and how you've been tweaking things to fit you. =)
In emacs I get my freedom, it's cool. And in 2020.. it's the 2nd or 3rd lightest choice.
Writing go, it even auto-formats your code and auto-adds imports.
With LSP and the various client implementations I'm legitimately more productive in Emacs writing Python, Go, or Rust than whatever flavor of the month IDE thingamajig. Magit and Org are the cherry on top of the sundae.
That said I don't push my beliefs on anyone in my team and I try to learn JetBrains products to make pair programming easier for folks that don't use Emacs.
https://pkg.go.dev/golang.org/x/tools/cmd/goimports
It's how Emacs handled inputs before there was lsp-mode, and presumably is easy to link into other editors too (it's just an implementation of gofmt that manages imports). I agree: it's an extremely nice feature to have.
Flycheck still makes it a bit slow. I think, one big missing piece is lack of multiple threads, which often makes few things a bit laggy. For example, if I'm reading a big C++ source code with indentation guides[1], even with native-comp it can lag a bit.
However, as a general text editor, emacs is still great. And I enjoy org-mode.
I dropped Emacs for NeoVim because Emacs would frequently lockup for a second or more due to LSP. NeoVim doesn't have this problem.
I would love to return to Emacs someday.
Anecdotally, a few months ago I wrote some Flutter on a potato laptop, NeoVim native LSP client + nvim-compe was borderline unusable. The vim-lsc somehow fared much better - albeit still choppy - even though it's written in vimscript. Emacs + eglot is the only combination that was smooth.
So how about a more modern take on Emacs that doesn't pull punches? Let's go.
1. Finally use a proper LISP like Common Lisp, SBCL or Racket? (Maybe even Gerbil Scheme, last I checked it it was pretty nice to look at and code in.) While you're at it, make a transpiler from Elisp to the LISP you end up using?
2. Make sure your core editor is mega ultra super fast for a change? It's frankly pitiful to have Emacs lag on a server-grade / workstation CPU with an NVMe SSD when you are trying to pick one of 2000 files in a project. I should not even NOTICE a lag on this machine! I can enumerate ~10,000 files in the Alacritty terminal before I manage to blink and press Ctrl-C, so what does that say about Emacs? (And make ahead-of-time / JIT LISP compilation the default and only option for running LISP code, please!)
3. Drop GUI efforts and just make a full-blown terminal-only version? (This might be achievable with build flags and/or fetching certain packages if I remember correctly.) I mean, the GUI efforts are historically nothing short of heroic but if Emacs is going to lag severely on a retina 5K screen (iMac Pro) then obviously somebody is hard-coding assumptions into some GUI code somewhere. Not a good software design.
4. Use async interfaces to external tools like language servers? It's baffling to have my editor completely locked for 5-10 seconds when I first open a file in a project. I am sure I'll survive without compiler warnings for that period of time.
5. Oh, and can we stop lagging the editor on every scroll because the font has more than 1000 graphemes, please? My Apple IIc computer could handle a file with 1000 records in 2-3 ms (excluding time loading it from the floppy disc, of course). I know it's not the same but come on.
---
Emacs is dated in many ways. But I am not seeing any will for a change. It seems the team is happy with gradual super-careful steps until the end of time.
I mean, that's fine, obviously it's their prerogative and all others can't do anyhing.
But this here is one last cry from me; a cry for some common sense and perspective before I swallow my low-energy levels (pre-diabetes) and lack of time (family man) and sacrifice my not-so-much sleep and me-time and finally learn NeoVim. I am sure it's going to be worth it even if it ruins my health for a few weeks because the people there are actually invested in performance, lightweight operation and ergonomics.
And it is amusing that async through a buffer has always been possible. Just far more common for folks to not go that route on round one.
Every time I get back to trying out emacs again, I find myself wondering why I would bother with the massive time sink to get it customized to be a sub-par equivalent to another tool that works better for me.
Doom emacs comes the closest for pre-configured setups, but even that isn't halfway to the productivity of what I am trying to replace.
What I really wish is sublime had gone with something other than python for plugins, and was more scriptable overall...
Can you give me a hint on how to do the async LSP thing then? I never was actually interested in becoming a master in Emacs. ¯\_(ツ)_/¯
That said, most of the newest lsp code is built with the idea that calls out to the server are fast enough to just block.
There is a terminal-only version, and it's not even new. It should be available without any build flags, though maybe you'll need a launch flag. Try emacs -nw from the terminal if emacs by itself launches a GUI window for you.
Could be my config but dude, it's a 99% almost pristine Spacemacs config. You can't get much more vanilla than that.
>vanilla
What? :O
Spacemacs is like 50k LOC away from vanilla config.