by jonnycomputer · 5y ago · 0 comments
Don't hate on me. I use Emacs just about every day. I used to use Emacs as my go to editor for writing code ... and it almost worked. But it was never hassle free, and things often worked more poorly than I would have liked, or ended up requiring too much fiddling to get it to work right, or packages were inadequately maintained. So now, I tend to use it for quick, short code writes, especially when I'm remoted in to a server. I also use it for org-mode, and for writing my book.
Now I use Pycharm for python and web development for things that can reasonably be called a "project"; the level of language support, introspection, and intelligent code prediction exceeds anything I ever achieved in Emacs.
I use VSCode for quick scripts, and for when I need to do maintenance work on some old php code. I like it fine. It fits in this really nice place between a full IDE and a bare bones text editor like Notepad or even BBEdit (ha!).
That and even when I was able to do development locally, it has been on a massive codebase (Chromium) that CLion literally cannot index (freezes, fails, lags etc.) and yet somehow clangd & lsp etc. don't have problems.
So hoorah for the continued excellence of emacs and assorted related open source tools. They may not be slick or well packaged but they are on the whole resilient because they're flexible.
Maybe language support will get better with LSP; anyone know how that is going in the emacs world?
My general impression of lsp-mode is that it’s great, once you get the settings the way you like them. Errors and warnings are nicely integrated into flycheck, and the lsp-ui package provides some niceties like automatically showing function signatures, showing error information inline with the code, and so on.
There’s also a “native-comp” feature that’s available experimentally in 28, which does native compilation of most of the .el files in emacs. I’ve played with it a bit and it does seem like a significant speed up across the board.
Definitely a lot of exciting things happening!
Like it can, but not on our codebase
I do debugging with gdb, which is rather nice actually (you can easily set breakpoints and it will show the pointer walking through all the files), but even there there are some rough edges (the in/output buffer will show up on all frames for example, and will pop up, closing the gdb buffer itself)
All in all this is a rather good setup imo, with a little polishing I'd never have to use anything else I think. Maybe I'll try out Doom again, it might be that my config is contributing to the unstableness...
Clang's developers might appreciate the corresponding bug reports.
I also do a lot of hobby Flutter/Dart development and the same is true there.
Languages that I’ve tried to work with this way but failed include Java, Kotlin, Swift, and C#. But I could see any of them working great if the LSP implementation was robust enough.
I have ADHD, so not being able to switch between active files/tabs/whatever + my TODO list at lightning speed + having to constantly use the mouse devastates my productivity.
That's to speak nothing of the embrace-extend-extinguish behaviors Microsoft has been exhibiting in its development of VS Code -- e.g., deprecating their open source, editor-agnostic Python language server in favor of a proprietary, closed-source VSCode-only server[1].
I regularly update and play around with VSCode in an effort to keep an open min, but frankly I haven't found it to offer anything worth the trouble + spiritual taint (I'm saying this sort of tongue in cheek!) of switching
- Completions need to take the type system into account (even in Python), etc.
- Emacs has to provide intelligent completions, linting, type-checking, compiler error annotations, type information, format-on-save, jump-to-definition, code search, etc
- It has to be easy to set the interpreter path for every one of the executables involved.
- This all must work in a dockerized development environment, including setting breakpoints in 3rd party code that may exist only in a container volume.
Clearly nowadays this has to be done with LSP.
I initially got a bad impression of lsp-mode and tried Eglot. However, (a) Eglot has been under heavy development, and (b) it has a complicated relationship to other core Emacs modules such as eldoc and flycheck/flymake (who can remember which is which) and (c) it threatens to become part of Emacs which means that its development will no longer be done openly with PRs but in an old-school mailing list with a lot of bickering.
So, it now looks like I'm switching to VS Code for programming on real projects, but sticking to Emacs for Magit and everything else.
It, uh, depends on the 1st and the 3rd of the mentioned packages.
> it threatens to become part of Emacs which means that its development will no longer be done openly with PRs but in an old-school mailing list with a lot of bickering
Joao has been saying that for a while, but seems like he has noticed after all that only a tiny percentage of the users get around to reporting bugs to Debbugs. Hopefully, that idea is dead now, or at least very much dormant.
On the other end, lsp-mode has been making strides in becoming more stable and polished, and making bells-and-whistles easy to turn off. So maybe try it again too.
In Emacs, I ordinarily have to wire half a dozen components to get this to work, and a different language may use different components. LSP is a great step forward here, in that most of the data and actions for aforementioned features come through a single pipe, so it's a matter of patching up the UI to taste.
Or the tiny things, like, does backspace at the beginning of text delete one space, back to the nearest indentation (e.g. 4 spaces) or back to the beginning of the line?
Moving between sublime on MacOS and VSCode on windows is death by a thousand needles to me. I can only imagine what moving between 3-4 editors must be like.
It helps that I set tooling based on language, so if I decide to use Pycharm for Python¹, I will expect Pycharm's behavior on every Python file. But I won't expect it on C, or Haskell, or SQL.
1 - I do change my opinnion over "a specialized IDE is best than emacs when it exists" a lot, currently I'm liking the interaction-free emacs interface more.
I also find myself using emacs short cuts when using Excel, which doesn't work, at all, of course.
This is so true. I too enjoy tweaking my Vim setup recreationally. It’s fun for me. Sometimes my wife will ask what I’m doing on the computer, and I have to try and figure out a way to explain that I’m customizing a text editor...
So, it's like android - touted as open source but with gotchas that you stumble upon once you are invested in the software, and that creates a lock-in effect. Also, the VSCode binaries released by Microsoft are non-FLOSS licensed and contain telemetry. That's why VSCodium exists, but they are crippled due to at least 2 core extensions being proprietary.
Possibly more core extensions could become proprietary.
PS: I know MS created LSP, so no need to remind in reply.
Why do you keep creating throwaway accounts for this?
Write a full blog post about it and get it on HN. People will for sure upvote it to the front page.
Out of curiosity and objectivity I tried Eclipse / IDEA git integration (a few years ago tbf).. they were still complex and distracting.
I'm not fond of org-mode it's too large imo but maybe it will fit your brain and you'll have a blast. Best feature to me is the source block (~tiny adhoc notebook).
Ultimately I want the code snippets in them to be executed in a docker container so that I won't have to install various dev tools in my host machine.
I used to try out Vim binding plugins every six months or so, until I realized that my IDE is forcing me to adopt a kind of hammock-driven-development, by being significantly faster at codebase comprehension while being significantly slower at codebase manipulation. With Vim I would never clone of a repo of a compiled 3rd party dependency in order to understand the dependency. I’d be forced to read through its repo on GitHub, since Vim’s speed-up of navigating through unfamiliar code is marginal. But with IntelliJ, I always clone the repo, create a project, and in a short time find the knowledge I’m looking for.
But in my experience, it's a wash. I've wasted a lot of time customizing my Emacs over the years, but I also wrought a lot of time savings out of it, which compound over time.
It's also a part of a bigger discussion about automation and developing support tools. The popular opinion is, better not spend time on it[0], but I feel that we tend to err too much on the side of doing things the hard way and waiting until someone on the Internet develops just the tool we need.
--
See https://xkcd.com/974/, https://xkcd.com/1205/ and https://xkcd.com/1319/ for the common arguments.
It can be said for any other text editor. Of course, specialized tools are better most of the time.
The open source community should pool resources to create code inspection, refactoring libraries for all kinds of languages, so all extendable editors can use these libraries to provide these features.
LSP is a first step for this, but there needs to be a deeper language integration to give intelligent tips, refactoring operations, etc. for all popular languages.
Emacs specifically also needs a lot of user interface-side polish to deal with the increase in the complexity of these plugins.
Emacs hits the mark a great deal and it is a very versatile and adaptable tool, but of course it will have it limitations. As much as one truly desires to find the silver bullet, one will be always disappointed.
Having said that, I do often wonder what emacs could be been if it saw the adoption levels Vim has seen.
- Everything - especially any GUI element - having a fallback to text, so that you can get equivalent workflow for terminal and GUI.
- Everything being kept "in the open", in easily parseable data structures, from the POV of Elisp, so that things can easily interoperate with each other.
- Rendering arbitrary fonts and graphics, which is super useful for more advanced UI elements, and about any time you need something from the Web.
The usual "next step" for an editor to suddenly gain a lot of functionality would be, "embed a webview". Except this fails the first two points. But on the other hand, there's only so much you can do with text if you want to use more complex tools for the mind - like graphs. Or even if you want to pack data more densely (overlapping icons, semi-transparent or pixel-aligned popups, whatnot).
Perhaps what we need to advance Emacs is to first standardize on terminal emulators, and associated protocols, that can render pixel and vector images - and some kind of mental framework to make them seamlessly work with text, in a way that doesn't turn into DOM.
(And also threading. If we could just get proper multithreading to work reliably in Emacs, things would improve greatly.)
Use it in complex way and you will stumble upon plethora of troubles. That is feature, not bug.