Live data from Hacker News

Emacs is the 2D Command-line Interface

hongchao.me

131–140 of 180 posts

Re: Emacs is the 2D Command-line Interface

#131

Sometimes I think people trick themselves into thinking that all their fiddling with Emacs counts as part of their productivity. 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, o…

I'm in the same position. I've used Emacs intensively for 20 years and I'm the author of Emacs packages that other people use. Nowadays I work on Python, Rust, and Typescript/$JSFramework projects. Here are some of the requirememts: - 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 inf…

To the four bullet points you mention, I'll add a meta-point: this all needs to be easy to set up simultaneously, per language. That's where commercial IDEs and editors shine - you get all these things properly set up out of the box.

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.

Re: Emacs is the 2D Command-line Interface

#132
post #116

Earlier quoted context omitted.

Its also a daemon that does a lot of work for me from the shell! I meta-click to capture xterm output, call dired, make it give me popup-windows to edit short scripts and long command lines, i query the feed-reader, get my backup-schedule, have it popup for debrief when new voice notes are downloaded, serve as an emergency window manager, capture into multiple bins while browsing, turn into a presentation tool, creat…

Can you do all of those without emacs ? My point is that yes Emacs can do so many things, but 1) it's all accessible from Emacs only and 2) it uses Emacs-only components. This is fine if you live inside Emacs, but it doesn't really integrate with the rest of your system

Emacs is your system. You can't integrate all that well in the other direction, because host OS platforms don't let software interop as well. Even the Unix family.

The deep interop of course comes at the expense of security. There's no sandboxing or restrictions in Emacs world. One day somebody will release a piece of elisp malware, and a lot of people - myself included - will lose their crown jewels. But until then, we get to enjoy the only remaining relatively mainstream OS with deep interoperability.

Re: Emacs is the 2D Command-line Interface

#133
post #23

As an Emacs and Lisp lover, the description of text-based tools and the power of using text to me just screams why something like Lisp is so powerful: homoiconicity. (And at least one big difference for elisp compared to Bash.) To quote Wikipedia [0] for anyone unfamiliar with the term, as I was until learning some Lisp: "A language is homoiconic if a program written in it can be manipulated as data using the languag…

I've been hearing the "code is data" mantra often, but the reason I never thought this was a desirable property is that it seems trivial to define any number of languages as their own AST. But there is a good reason that we don't program by writing out ASTs - it's relatively hard to read and manipulate. Does the Lisp implementation just happen to be particularly readable?

It's kinda of a messy concept. Source code is never like an AST, because an AST is a tree on a computer's memory, with pointers and everything, while source code is text.

I see no reason why a language can not have a more complex source -> AST transformation, while still keeping code as readable data that can be manipulated by macros. So, if you want homoiconicity with a slightly more complex syntax, I don't think it won't bring any problem.

But if you keep making your language's syntax more and more complex, you will make macro creation harder and harder, so there is probably a practical limitation somewhere. Operators and statement sequences are very likely not complex enough to be a problem, but I don't think anybody will ever make native C++ macros work.

Re: Emacs is the 2D Command-line Interface

#134

Sometimes I think people trick themselves into thinking that all their fiddling with Emacs counts as part of their productivity. 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, o…

A heads-up that VSCode's remote extensions and Python LSP (pylance) are proprietary. So they can't be used in forks like VSCodium. Pylance is set to replace the current Python LSP. 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 conta…

https://news.ycombinator.com/item?id=26513727

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.

Re: Emacs is the 2D Command-line Interface

#135
post #65

Emacs is a text UI (though it can show images too) on top of a cross OS programming platform where you can create quick UIs for any kind of task you have (interfacing with APIs, command line programs, editing tasks, etc.). Once you learn how Emacs works and how it can be programmed, you can create interactive tools extremely quickly to make lots of tasks you encounter day to day easier. I do this all the time.

Do you have any references/tutorials/examples on how to do this?

"Writing GNU Emacs Extensions" by Bob Glickstein is a solid introduction. After that, the Emacs Lisp reference manual (available as "info elisp" in the shell) gives much more detail.

Inside Emacs, you can:

- "M-x apropos" to search for commands of interest

- "C-h f" to get documentation for particular functions by name

- "M-x find-function" to jump to the definition of a particular function

- "M-x find-library" to load a library into a buffer so you can read and (depending on your permissions) edit it.

The Elisp reference is very good, and most libraries are well documented. Between that, the ability to jump around the code base, and trying things out in the "scratch" buffer (it's an Elisp REPL disguised as an editing buffer), you should be able to get quite far.

Re: Emacs is the 2D Command-line Interface

#136
post #65

Emacs is a text UI (though it can show images too) on top of a cross OS programming platform where you can create quick UIs for any kind of task you have (interfacing with APIs, command line programs, editing tasks, etc.). Once you learn how Emacs works and how it can be programmed, you can create interactive tools extremely quickly to make lots of tasks you encounter day to day easier. I do this all the time.

Do you have any references/tutorials/examples on how to do this?

Emacs has built in documentation. Learning emacs lisp is a good start:

https://www.gnu.org/software/emacs/manual/html_node/eintr/in...

This manual is also the part of the emacs distribution.

Re: Emacs is the 2D Command-line Interface

#137

Sometimes I think people trick themselves into thinking that all their fiddling with Emacs counts as part of their productivity. 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, o…

Same experience here, but as a Vim and IntelliJ user. I can edit a single file or a few buffers in Vim maybe twice as fast as I can in IntelliJ. However, I can navigate through a codebase 5x as fast, which means that when I’m doing anything that requires an understanding of parts of the codebase I haven’t memorized (95% of it), my IDE is speeding up my development by nearly 5x.

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.

Re: Emacs is the 2D Command-line Interface

#138
post #67
post #61

Earlier quoted context omitted.

> I'm advocating for improving the out-of-the-box usability story so that the editor isn't putting people off before they get a chance to understand and experience its power. There are atleast a couple of projects like spacemacs and doom-emacs that already do that. The problem with the point you are making is someone has to do that hard work and also need to market it to the beginners. There isn't any money to make E…

>There are atleast a couple of projects like spacemacs and doom-emacs that already do that. Both of which are not really true to the core Emacs philosophy in several ways though. And thus, they add a whole new layer to have to debug when something breaks. >So i doubt it's ever going to be better than it already is through collaborative efforts of people with different goals. But there are plenty of open source projec…

> The question is whether we want Emacs to be the best text editor for everyone, or the best text editor for an elite few.

I can answer that for you. Emacs definitely wants B). They might pay some lip service to A), but as usual, keep your eye on what people do, not on what they say.

To offer a comparison point, Neovim. Neovim is also an Open Source project, but it wants to make Vim more powerful > more user friendly. So they've removed obscure stuff, made the default configuration newbie friendly, etc.

Emacs is too afraid of this. It has a ton of long term users that just don't want their defaults changed. There's a reason this XKCD is about Emacs: https://xkcd.com/1172/

I think Emacs will change over the following decades. Not because its users will >, but because its > will change. To clarify, it's like that saying about science: science advances, one funeral at a time.

Re: Emacs is the 2D Command-line Interface

#139
post #68

Earlier quoted context omitted.

>Only a small portion of the article is about SW development. The article, is, however written by a software developer. >The fraction of Emacs users who use it primarily for things other than programming is a lot bigger than most HN readers think it is. Do we have any hard data here? Or is this just an anecdote? Sure, Emacs is usable for a lot of stuff outside programming. I personally use it for org-mode and as a ge…

> Do we have any hard data here? Or is this just an anecdote? 55% according to the Emacs survey 2020 (obviously, take it with a pinch of self-selection bias due to the survey being self selecting). [1] https://emacssurvey.org/2020/

And yet that same survey says 91% use it for software development, too.

Re: Emacs is the 2D Command-line Interface

#140
post #68

Earlier quoted context omitted.

>Only a small portion of the article is about SW development. The article, is, however written by a software developer. >The fraction of Emacs users who use it primarily for things other than programming is a lot bigger than most HN readers think it is. Do we have any hard data here? Or is this just an anecdote? Sure, Emacs is usable for a lot of stuff outside programming. I personally use it for org-mode and as a ge…

> Do we have any hard data here? Or is this just an anecdote? 55% according to the Emacs survey 2020 (obviously, take it with a pinch of self-selection bias due to the survey being self selecting). [1] https://emacssurvey.org/2020/

You're completely misreading that graph, I think. And that graph actually proves his point.

91.4% of Emacs users use it for coding (so the overwhelming majority, as you'd expect), and then some of them use it for something else.

Those groups are not separate, if you look at the percentages, they add up to a lot more than 100%. So people could check multiple options.

All this tells us is that:

A) Emacs is primarily used by devs (hardly surprising :-) )

B) The devs that use it also use it for other side tasks (also hardly surprising, considering Emacs' kitchen sink philosophy).

Post reply on HN