Let us write plugins in whatever programming language we want and provide some simple interface like Unix sockets or something for us to communicate with the editor process. Instead of making the first class installable extensions plugins create a primitive called modes that encapsulate groups of plugins with extra configurations so that instead of having to pick every plugins for our setup we just pick the most popu…
Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
201–210 of 340 posts
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#202I’d get rid of the text editor and swap in neovim or hx code as a mode, I’d chuck emacs lisp and use Common Lisp instead, I’d definitely keep org mode and ditch old stuff like mail and news reader as core and let them be add ons written in CL . Rewrite it all in rust. That’s probably enough for today.
What advantage would you get by rewriting it in Rust?
Also, with Lem you don't have to care about Rust. Just keep coding CL to achieve anything with a REPL. You don't have to wait weeks to recompile.
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#2031. I would like higher-level datatypes for key abstractions, such as (1.1) Marks -> StableRegions - reference specified text within a buffer - continue to reference same text despite insertions or deletions (1.2) Strings & characters -> StringBuffers - lightweight immutable buffers (no branches or versions) - able to hold any content a subset of a buffer can hold - could be StableRegions of an Arena Buffer (1.3) Abst…
Are all these “higher-level datatypes for key abstractions” trying to achieve first-class collaborative editing? That sounds a lot like Zed.
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#204Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#205Earlier quoted context omitted.
I'd be happy to break terminal mode (which I almost never use) in exchange for getting this feature.
whereas I use emacs exclusively in terminal mode, and would be rather upset to it no longer supported :)
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#206- Use Common Lisp instead of Emacs Lisp. - Design a more modular architecture to make it easier to extend and maintain different components. - Design a more robust plugin system for development and distribution of extensions. - Implement better sandboxing and security measures for extensions. - Better APIs for extension developers. - better multi-threading support baked into the editor.
> - Implement better sandboxing and security measures for extensions. Why, pray tell, should this be of any concern at all? Sandboxing is used when the host is concerned about running programs that he doesn't trust. There is no reason that an Emacs package would require security measures around it, unless it were knowingly potentially malware. The only reality in which I could see this is if people were using proprie…
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#207Earlier quoted context omitted.
Well, Emacs does ship with a browser (because of course it does, that kind of thing is what makes Emacs so amazing) and we all remember the XZ Utils near-backdoor, so I think that security measures would be useful for people who decide to use a less trustworthy archive like MELPA or who install extensions with package-vc.
Just create another user account and test your new stuff there.
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#208More to the point, emacs already has been rewritten substantially. There’s the initial rewrite from TECO to lisp, there’s the 80s implementations like uemacs (famously used by Linus), we had a major fork with xemacs in the 90s, there’s guile emacs (ready any day now), lem is almost but not quite a Common Lisp emacs, and it’s been making a lot of progress recently. So go ahead with your rewrite, you’re in fine company…
1.https://multicians.org/mepap.html
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#209Not using lisp
I don't like those languages, and I have just as much right to say that as the people who don't like Lisp.
Re: Ask HN: If you were rewriting Emacs from scratch, what would you do differently?
#210I would use a more mainstream dynamic language like python or lua rather than emacs lisp. It has to be dynamic and maintain the flavor of repl-driven development (the whole point of emacs is that it’s one big X repl where today X is emacs lisp). It doesn’t have to be a lisp though.
One has to experience the flow, the fluidity, the functional constructs of Lisp to truly appreciate its elegance and expressiveness. Lisp's code-as-data philosophy enables seamless metaprogramming, where code can be treated as data and manipulated with the same ease as data structures. This unlocks a level of abstraction and composability that is unmatched by most other languages. The functional nature of Lisp, combined with its homoiconicity, encourages a declarative and modular programming style, promoting code reuse and maintainability. Once one immerses themselves in the Lisp way of thinking, the flow of writing code becomes a harmonious dance, where complex problems are broken down into simple, composable functions that can be effortlessly combined and transformed. It's a paradigm that fosters creativity and empowers developers to build robust and extensible systems with remarkable ease.
Sure, Python, Lua, Javascript, etc. They all may seem more familiar, and yet they lack the profound simplicity and expressiveness that lies at the heart of Lisp. While these languages have their own merits and widespread adoption, they are ultimately constrained by their rigid syntax and imperative nature. Lisp, on the other hand, transcends these limitations with its minimal yet powerful syntax, allowing code to be treated as data and data as code seamlessly. It fosters an unparalleled level of metaprogramming capabilities, enabling developers to write code that writes code, unlocking a realm of abstractions and transformations that are challenging or impossible in other languages.
Yes, very challenging, see the examples of using Hyperfiddle/Electric, here's one: [SpreadSheesh! talk by Dennis Heihoff - YouTube](https://www.youtube.com/watch?v=nEt06LLQaBY)
When you say "It's one big X REPL... and it doesn't have to be Lisp", it's already conflicting because you need Lisp to have the proper REPL experience. Those non-homoiconic languages that promise a REPL don't actually provide the "real REPL" experience. Their interactive shells are more limited in comparison to the true REPL provided by Lisp dialects, where code and data are seamlessly interchangeable.
upd: darn, I guess I didn't scroll too far, all the people complaining about Lisp are at the bottom, downvoted and I guess angry because they don't understand why. It's like someone moving from China to US and complaining why everyone refuses to even try Mandarin, after all it's the most widely spoken language in the world, why wouldn't it make sense to use it instead?