Live data from Hacker News

Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

news.ycombinator.com

141–150 of 340 posts

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#141
post #125

Almost all the comments here are about things that really possible to do in current Emacs i.e. 'feature-requests' and not "fundamental pitfalls of this foundational application". For me, it would be just: - Redesigned with concurrency in mind. - Common Lisp, Scheme, or anything else other than Elisp. [Just the same way Neovim adapted Lua instead of VimScript] - More sane defaults for new users.

Hard agree that these are true ‘fundamental pitfalls’ of Emacs’ design. However I may go further on your third point. I would like to see a dedicated new user/learner mode that in addition to saner defaults would be pretty fully configured and pre-loaded with the most common extensions/plug-ins/etc. This could then lead to development of dedicated documentation/tutorials that assist the new user in becoming proficient in the common style/habits of Emacs usage.

This could provide a much simpler full featured ‘base’ state for the app, that can then be customized from that point or can be stripped back by removing the more common add-ons and customized from the ground up.

It would in some ways necessitate a strongly opinionated set of defaults and an additional focus on documentation, but I think in the long run the app would benefit from higher retention.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#143
post #125

Almost all the comments here are about things that really possible to do in current Emacs i.e. 'feature-requests' and not "fundamental pitfalls of this foundational application". For me, it would be just: - Redesigned with concurrency in mind. - Common Lisp, Scheme, or anything else other than Elisp. [Just the same way Neovim adapted Lua instead of VimScript] - More sane defaults for new users.

Hard agree that these are true ‘fundamental pitfalls’ of Emacs’ design. However I may go further on your third point. I would like to see a dedicated new user/learner mode that in addition to saner defaults would be pretty fully configured and pre-loaded with the most common extensions/plug-ins/etc. This could then lead to development of dedicated documentation/tutorials that assist the new user in becoming proficien…

> in addition to saner defaults

Isn't that cua-mode?

https://www.gnu.org/software/emacs/manual/html_node/emacs/CU...

> would be pretty fully configured and pre-loaded with the most common extensions/plug-ins/etc.

Doesn't it already do this? org-mode comes pre-installed for instance.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#144
post #47

I'd make cursors be positioned within the document instead of on the screen. Currently, Emacs does not support off-screen cursors. If you attempt to scroll a cursor off screen, it will move within the document to stay on screen. This behavior is contrary to all modern text editors, and there is no good workaround. I once made a serious effort to start using Emacs, but ultimately stopped because of the annoying cursor…

This is a really interesting case of Emacs being so old that its default (and only in this case) behavior is just unable to comprehend current computer technology and usage. I think I am correct in saying that the lack of capabilities to have horizontal scrolling of a screen was an absolute hard limit of the teletype and terminal era. It should not be difficult to add such capability, but more than the obviously connected portions of Emacs’ code could implicitly rely on the assumptions that come from the impossibility of horizontally extending text.

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#145
I have actually done some work on a rewrite of the Emacs core in rust[1], so I have thought a lot about this question. Most of the things you would want to change could be fairly easily added to the existing Emacs. The biggest ones that are hard to do with the current core is concurrency and collaborative editing. My particular core is focused on concurrency[2].

Unlike a lot of commenters here, I am trying to stay backwards compatible with elisp. It is not the best, but huge body of existing code is one of the strengths of Emacs. Unlike vimscript, elisp isn’t painful enough to be worth replacing.

[1] https://coredumped.dev/2021/10/21/building-an-emacs-lisp-vm-...

[2] https://coredumped.dev/2022/05/19/a-vision-of-a-multi-thread...

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#146

I'd replace the underlying data structure used to represent buffers ( https://www.gnu.org/software/emacs/manual/html_node/elisp/Bu... ) with something more sophisticated, like ropes or piece tables.

I wrote some comparisons here

https://coredumped.dev/2023/08/09/text-showdown-gap-buffers-...

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#147
post #125

Almost all the comments here are about things that really possible to do in current Emacs i.e. 'feature-requests' and not "fundamental pitfalls of this foundational application". For me, it would be just: - Redesigned with concurrency in mind. - Common Lisp, Scheme, or anything else other than Elisp. [Just the same way Neovim adapted Lua instead of VimScript] - More sane defaults for new users.

Hard agree that these are true ‘fundamental pitfalls’ of Emacs’ design. However I may go further on your third point. I would like to see a dedicated new user/learner mode that in addition to saner defaults would be pretty fully configured and pre-loaded with the most common extensions/plug-ins/etc. This could then lead to development of dedicated documentation/tutorials that assist the new user in becoming proficien…

> I would like to see a dedicated new user/learner mode

“To run the tutorial, start Emacs and type C-h t, that is, Ctrl-h followed by t.”[1]

[1] https://www.gnu.org/software/emacs/tour/

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#148

Earlier quoted context omitted.

> Crazy side of me would like to see it fully written in a safe(r) language like rust, swift or zig. Emacs Lisp is a very safe language. Even though the Emacs core is written in C, that is immaterial and impalpable to Emacs users as they only interact with Emacs Lisp. What benefits would Rust / Swift / Zig bring to an average Emacs user? > Basically your config would be a recompiled subsystem, loaded at runtime, or y…

The pseudo-JIT provided by gccjit is really quite good. I’ve been using emacs for a pretty long time and it is definitely the most noticeable improvement they’ve added so far (and it even works seamlessly out of the box on windows!)

It is exceptionally good, indeed. Emacs now starts up in an instant (< than 1 sec) from the cold to a fully working state, which includes loading a hefty .emacs

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#149
post #47

I'd make cursors be positioned within the document instead of on the screen. Currently, Emacs does not support off-screen cursors. If you attempt to scroll a cursor off screen, it will move within the document to stay on screen. This behavior is contrary to all modern text editors, and there is no good workaround. I once made a serious effort to start using Emacs, but ultimately stopped because of the annoying cursor…

It (kinda) has multiple cursors per document if you split the frame and display the buffer twice. For longer source files I find myself splitting horizontally, editing in the left pane, and using the right pane for secondary movement and reference. I have a buffer manager that can switch the displayed buffer quickly, when I switch to a different buffer and back again, it retains it's "secondary" cursor position that…

[deleted]

Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?

#150
post #95
post #37

Earlier quoted context omitted.

god yes please. "Will I get a new window? If so, where will it be?" If I could have Emacs with Acme-style window management, that'd be perfect

this is emacs territory so we have infinite customization via the `display-buffer` primitive. see https://www.masteringemacs.org/article/demystifying-emacs-wi... for more information.

Thanks for reminding me about this, I really need to dig into it and get some rules in place.
Post reply on HN