117 points · by volemo · 2y ago · 334 comments
- 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.
All that said, it seems like Emacs has been improving rapidly the last few years: native compilation of Elisp, LSP support, good integrations with LLMs.
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.
“To run the tutorial, start Emacs and type C-h t, that is, Ctrl-h followed by t.”[1]
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.
Similarly, recentf-mode exists but is not the default. Or has that changed?
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 is separate from the other view.
Markers are used to mark a different point in the file and one can pop their location to a previous mark.
In response to keypresses, it doesn't bother me too much, as I'm used to the Windows-style behaviour of PgUp/PgDn/etc. moving the caret, much as the Mac behaviour of not doing that is sometimes useful. But for mouse wheel scrolling, which I do a lot - precisely because on Windows this typically does not move the caret! - having point follow along has never felt right.
Iam pretty sure you can customzize that if you want.
> scroll-preserve-screen-position is a variable defined in ‘C source code’.
> Its value is ‘keep’ > Original value was nil
> Controls if scroll commands move point to keep its screen position unchanged.
> A value of nil means point does not keep its screen position except > at the scroll margin or window boundary respectively.
> A value of t means point keeps its screen position if the scroll > command moved it vertically out of the window, e.g. when scrolling > by full screens. If point is within ‘next-screen-context-lines’ lines > from the edges of the window, point will typically not keep its screen > position when doing commands like ‘scroll-up-command’/‘scroll-down-command’ > and the like.
In emacs the cursor would be somewhere around line 600 instead.
The world could probably make room for an integrated Lisp development environment that makes GUI programming more of a first class citizen. Maybe something like Medley Interlisp?
- It can render different fontsets
- PDFs
- SVG and images
- Emojis and file icons
- Tooltips
- Drag&Drop and better mouse support (scrolling, selection, etc.)
I think it would be great to have a better GUI layer and native web-browser integration. Emacs' evolution doesn't have to be constrained by terminal limitations, and so far it doesn't seem that it was.
I suspect that with sixel support, and kitty image protocol support, images could be shown, too. At least, Eat, the elisp-based terminal.emulator, manages to show sixel graphics inside Emacs.
- instant startup
- blazingly fast scrolling
- minimal keypress-to-display latency
I have written a lot of elisp (and had to deal with with buffer variables, dynamic scope, etc.), but aligning with modern scheme or lisp (if it can be kept compact and efficient) probably makes sense at this point. (Current emacs should provide backward compatibility as needed.)
Since so many people use emacs as an IDE, I think having an official emacs co-project/subproject focusing on a standard, extensible IDE framework (perhaps for other apps as well) would make sense.
It still seems like a pain to display graphics in emacs in various terminal apps. This should be easy, fast, and standardized.
As others have noted, supply chain attacks against open source are rampant, so vetting and sandboxing packages seems to be more important now.
What kind of HW are you running emacs on where this isn't the case?
https://pavelfatin.com/typing-with-pleasure/
If you have better numbers and comparisons for emacs keypress-to-pixel latency, etc. I'd be interested.
Note classic vi started up faster than vim.
Device makes little to no difference: Raspberry Pi 5, MacBook Pro M1, ThinkPad P1, etc. - emacs is clunky on all of them. I like emacs and it's my daily driver. But it isn't fast.
see also:
"Computer latency: 1997-2017" https://danluu.com/input-lag/
"Measuring keyboard-to-photon latency with a light sensor" https://thume.ca/2020/05/20/making-a-latency-tester/
Yeah it’s faster at starting up but it’s worse in pretty much everything else.
Oh and they end up typing Ctrl-this Ctrl-that anyway.
Might as well use gnu emacs.
b) Use https://github.com/blahgeek/emacs-lsp-booster
c) Tweak GC vars, see: https://emacs-lsp.github.io/lsp-mode/page/performance/
d) Use plists for deserialization (described in the previous link)
e) Learn how to use built-in profiler and don't hesitate to launch it, sometimes simply disabling some minor-mode in specific setting is all it takes
f) Current state of Tree-sitter in Emacs is a mixed bag - for some modes you get huge improvements, for others it's the opposite. YMMV.
If you don't run the output through those 2 functions, then non-printing characters remain in the output that severely undermine legibility.
C programmers tend to develop the ability to glean information from the voluminous output of build processes as it goes whizzing by on a terminal, so they find compilation mode frustratingly slow. Or at least that is my guess as to what happens.
As an aside, having it running in the background was actually the way the original EMACS that ran on ITS was intended to be used: When you C-x C-c out of it, it does not kill the program, it simply puts it in the background, and the next time you invoke EMACS it brings it back up. This is similar in effect to hitting C-z, then using 'fg' to bring it up again, but this only really works in a terminal. The Emacs server achieves the intended effect better, especially on a graphical display.
emacsclient is useful on its own. For example, I use it to edit just about any text, in any input box in any app, delegating the task to Emacs, or when I want to open some URL in Emacs, while browsing a web page in my browser, or to send some selected text to Emacs.
Not that you can't work that way (and using `emacsclient` is the way to do it), but you're losing out by trying to shoe-horn usage patterns familiar from other toolchains onto Emacs. Emacs is not a text editor, it's a text manipulation platform that includes an editor - a number of editors in fact, including a vim clone.
My config is Doom-based. I use about 300 different third-party packages, and I don't even know how many built-in ones. It takes about 1.3s to start. Wishing for it to start even faster is like wanting my microwave to warm my tortilla in 5 seconds instead of 30. I don't restart Emacs every day, nor do I eat tortillas daily. Use a modern package-manager, and defer the loading of packages, it will start very fast - just like 'emacs -q' does.
> minimal keypress-to-display latency
A lot of times, setting keyboard rate is all it takes to make it nice,
On Linux: xset r rate 170 80
On Mac:
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
- 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.
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 proprietary Emacs extensions, in which case I would entirely understand it, because then people would be willingly running malware inside their editor. Perhaps this the stance VS Code users like to take towards extensions?
Trust? Trusting criminals doesn't stop them from committing crime.
You may trust your emacs color theme author. Pretty colors from an innocent artist. You run the theme code without any sandboxing. Everything is going well. Then the author adds a keyloger, project code scrapper, and phone-home feature in his theme.
You update all your emacs packages automatically without any code review. Then you start getting emails from your companies security team asking why you uploaded sensitive projects to a 3rd party.
Wouldn't it make more sense to restirct color themes to color and font related tasks? Why should a color theme be allowed to scrape sensitive code from your disk and upload it to a 3rd party without your consent?
> You update all your emacs packages automatically without any code review. Then you start getting emails from your companies security team asking why you uploaded sensitive projects to a 3rd party.
If you do not trust the author or maintainers of a random program and refuse to review any code updates before installing it, then you are a moron.
I think if there is a concern that people would upload malicious packages, then there would be a level of trust put into the repositories that accept and offer them to review submissions before accepting them. This is still imperfect, but it shifts some responsibility off of you.
> Wouldn't it make more sense to restirct color themes to color and font related tasks? Why should a color theme be allowed to scrape sensitive code from your disk and upload it to a 3rd party without your consent?
Why SHOULDN'T a color theme be allowed to scrape code from your disk? Maybe the color theme is sophisticated enough to want to do that, or talk to some network. Something like a seasonal color theme that responds to the local weather might have a lot of hack value; and that is precisely the point you are missing. Emacs is not about restricting what you can and can't do, because the designers of Emacs understand that restricting what the user is allowed to do ultimately hinders freedom and creativity. It is one of the very few platforms left that's still like that, and I believe it should stay that way. If people want to use an editor that's very safe and tells them what to do rather than vice versa, then they should probably consider VS Code, or something like it which DOES upload your data to a third party without your consent, because it is smarter and knows better than you what you should be doing with your computer.
I don't really see how the XZ backdoor is relevant to this conversation, since these types of exploits are the fear of server operators, and generally not people who run user programs like Emacs on their desktop. A rogue Elisp function could delete all of the files in your home directory if it wanted to, but people don't really complain about that because being able to delete files is a desirable function.
If you ask me, Emacs is a program where user freedom is and should be the ultimate goal. Adding security features that the user has to jump around 'for his own good' and only really serve as idiot nets are dubiously effective and only hinder this freedom. If someone wants to install a package from a source other than the official archives, then the trust is placed in him to actually look at the source code he's received. Even if you install an official package you should still look at the code, as it's quite useful to know what's going on inside it when you want to configure it or add functionality. The vast majority of packages I use are a single file and tend to not take up more than a few screens, so they are easily understandable.
Interesting, why not a scheme? Is it because the popularity in the industry? I don't know much about Emacs or lisps and looking to understand better
UI: Electron, of course.
Json to represent the edit buffer in RAM. Each utf8 code point base64 encoded, in a json array, it itself, as a blob, base64 encoded. Now, before you complain that that is gonna blow up the data too much, don’t forget that 1. “Ram is cheap” and 2. “gzipped base64 is about the same size as binary”. So, of course, we’ll gzip the data in RAM.
Plugins should be JavaScript, as should be self-evident. And you’ll need a few installations of python (both 2 and 3) and node.js (each in its own docker container, obviously) to glue it all together and provide reproduceability.
With some care and work, it’ll run even on a modest machine taking up merely 60GB of disk, 32GB of RAM, a 4090ti GPU, and 8 CPU cores.
Every key press should be passed through an LLM, to add some intelligence to the editor. The user will, of course, supply a ChatGPT api key when they register for their mandatory myNewEmacs.ai account that they’ll need to subscribe to the editor for only the cost of a few lattes a month.
It is 2024, after all. One must use modern tools and technologies.
Get rid of any keybinding or UI convention that is there because that is the way they did it the AI Lab in 1967. Make the UI as familiar to the average computer user as possible (but keep the general design of a large rectangle of text) by using mainstream conventions (which come mainly from the Mac and Windows) for how to respond to this or that keypress or to clicking or dragging with this or that mouse button.
Inside Emacs is a cross-platform toolkit (where the platforms are MacOS, other Unix derivatives, Windows and the terminal) I would split Emacs into 2 projects: a toolkit and an app that uses the toolkit. That way, if someone wants to create an "standalone" org-mode app, Magit app or Gemini browser designed to appeal to people who do not want to spend any time learning to use Emacs the app or "Emacs the generalized interface to information", they have a straightforward way to do so. (These "standalone" apps that are as easy to learn as any other GUI app will I hope help popularize the Emacs ecosystem.)
One thing I definitely would not change is I would not make Emacs dependent on or closely integrated with a browser engine.
Do you have an example of this? I can't tell any difference for the fonts that I use (with emacs-pgtk). I believe Emacs uses Harfbuzz (same as Chrom{e|ium}).
Does your Emacs usually use a proportional-pitch typeface? If so and you're on Linux, I'll install the font you are using.
I've tried using proportional typefaces in Emacs (on Mac), but there was something off, so I went back to monospaced. I could try again now that I have a Linux machine.
The text in my Emacs looks almost exactly like the text in my Gnome Terminal. (A slight difference in size is the only thing I notice. To be painfully precise, (window-system) evals to 'pgtk on my Emacs.)
The text in Gnome Terminal is not terrible, for sure, but text on the web is a nicer in my experience.
(custom-set-faces '(variable-pitch ((t :family "Verdana" :height 180))))
And then in the buffer you wish to view with proportional type, M-x variable-pitch-mode.Emacs is perfectly capable of rendering other fonts, too, though.
There are other options as well, like remapping the Enter key to act as Ctrl when chorded or using sticky modifiers. I think using an ergonomic keyboard with two large Ctrl keys on both sides of the keyboard is probably the best solution. I've discussed some of these alternatives in more detail <https://susam.github.io/devil/#why>.
By the way, there are some vendors that still make Unix layout keyboards with the Ctrl key positioned where Caps Lock key usually is: <https://deskthority.net/wiki/Category:Keyboards_with_Unix_la...>.
It works really well, and makes emacs much more comfortable to type in.
Downside is this keeps me locked to X11 and fighting the occasional app that reads the key codes directly.
Tangentially, I really loathe how Wayland has no alternative to this. I'm expected to configure keyboard layouts in every DE or WM I use, which is a much worse UX.
[1]: https://vincent.bernat.ch/en/extending-xkb#attaching-symbols...
They also at some point joined the PC world in moving the nubs on their keyboard from "d" and "k", where you were more likely to notice if your fingers are not in their proper place on the home row. Now if your right hand is offset slightly to the right, you won't feel anything, which is less immediately noticeable than if the nub were under the wrong finger.
Caps lock was rightfully relegated to bottom left.
That's indeed true! But the premise of this question explores the scenario: What if we did rewrite Emacs from scratch?
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...
(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) AbstractBuffers
- immutable buffers + a tree of deltas
- some special delta types for, e.g. indentation
- AbstractBuffers support transactions and versioning
- can support collaborative editing
- specific versions can be written to textfiles
- all versions can be stored in git or in relational database
2. Use WebAssembly instead of a specific programming language.
- This was the vision for Guile.
- Scheme one of several languages.
- ELisp supported but Emacs port efforts keep failing!
- The Racket ecosystem has captured this pretty well
- if only it supported ELisp!3. Prefer languages at least as simple as Scheme, but with monotonic semantics!
Non-mutable operations would appear as transactions appearing as branches/versions.
An editing session would automatically follow the latest transaction in the current branch.
Concurrent edits of the same "file" create different branches as with git, et al.
4. Separate monolithic Emacs process into SessionProcesses, DisplayProcesses and WorkerProcesses.
Multiple DisplayProcesses would allow for tightly-coupled collaborative editing. A WorkerProcess would interface buffers with processes, files, git repositories, etc. on a specific account@host giving functionality like Tramp. A user would start with one DisplayProcess connected to a SessionProcess. A SessionProcess would provide the interface between DisplayProcesses, WorkerProcesses and any co-SessionProcesses of collaborators. WorkerProcesses could be scripted without any other overhead.
I'd make lexical scope the default and dynamic scope opt-in on a per-variable basis. This one is probably less controversial. I think the devs are moving in that direction (e.g. by changing emacs core code to use lexical scope and adding warnings for code that doesn't opt into it), but I don't see how they will actually be able to change the default without breaking a whole bunch of user code.
(mapcar #'list list)
It's like how if you want to treat a symbol as data you have to quote it: (let ((x 2))
(list 1 x 'x))Tongue-no-longer-in-cheek:
I reckon the C core of Emacs is some of the most battle-hardened code out there. Verification, a-la SEL4, is probably irrelevant but still nice. Guile is modern and performant but Elisp is still its own little joy. Literate programming is always nice until it gets in the way. Straight is good enough for me now. Macros are always cool and a leaderboard would be fun, but patch algebra is really nice, see jujutsu nowadays. And beard length is gendered and so only partially admissable. Infinity categories are way out there and always good for a reference.
you insensitive clod
Since I agreed with all of these, I’ll add some more non-ironic, idealistic wishes:
Plugins must be written in sandboxed WebAssembly so you can know what a plugin is capable of without reading the source code. The runtime must be portable so it can run in wasm32-wasi.
for the non-tongue-in-cheek, also relevant: https://www.emacswiki.org/emacs/GuileEmacs#h5o-2
I'm looking at pijul..
Though, not to put too fine a point on it, I know it was in jest, but the core implementation language is the least of my concerns. As long as it is extremely portable, compiles fast, and runs on virtually anything, then whatever the core is, doesn’t matter much to me.
Free Pascal does gigabyte strings you don't even have to allocate. Then I'd read the Emacs manual, and start writing code and tweaking TECO to make it all impedance match better.
But I'm old and weird, so maybe not the best way to get there.
Personally I find following email conversations much harder than just a single conversation thread like in a GitHub issue, for example.
A few years ago I very much shortened my .emacs file using the Straight package manager and I have been happier.
The repo-reference stuff works pretty well all things considered. If it were python it would be hell.
Crazy side of me would like to see it fully written in a safe(r) language like rust, swift or zig. Basically your config would be a recompiled subsystem, loaded at runtime, or you'd recompile the whole editor.
It wouldn't hurt if the config had a bit more structure. Forcing people to set fonts etc. BEFORE loading other things; essentially enforcing an order in which things get loaded. It can get hairy after years of working in emacs.
I love that it's keyboard driven and I'd keep that for sure.
The config should automatically be a git repository and any change should generate a meaningful commit (thinking out loud).
Better key handling and none c-x nonsense. Switching between keyboard combos and straight up shortcut should be a defined choice not overwritten by x. Every 'plugins' should expose their shortcuts override clearly. Have sane defaults that aren't 30 years of cruft. This means you'd have to consider running on mac just as well as windows, and in and out of the terminal makes this extremely tricky.
Better plugin system and discovery. Often the best and only way to find how to solve a problem in emacs was by finding some random gray-beard post on some forum by sheer luck.
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 you'd recompile the whole editor.
elisp -> bytecode compilation in Emacs… predates humanity?
https://www.gnu.org/software/emacs/manual/html_node/elisp/By...
The entire stash of Emacs packages compiles into the byte code at the package installation time, anyway. Personally, I even byte-compile-file my ~/.emacs to eke out an imperceptible speed improvement at the startup time, which is slightless less than entirely useless but it warms my heart that I can do it.
Recent versions of Emacs can also compile Elisp into the native code:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Na...
> Better key handling and none c-x nonsense.
Perhaps you do not need Emacs then.
Actually, I believe it was developed by HackerNews hater Jamie Zawinsky.
To you. To me it wouldn't. If it was Lua, I'd still use Fennel. If it was Javascript, I'd do it in Clojurescript; If it was in C, I'd probably find a way to use Common Lisp or Jannet; If it was Python I'd probably use Hylang or something; if it for whatever reason used JVM (like IntelliJ) or .Net CLR, I'd do it in Clojure.
You see, once you actually grok Lisp, at some point you do become a true "polyglot programmer" - for me switching between different runtimes - JVM, Node, Browser, Native, Lua, etc., is as simple as picking up a different Lisp dialect. Even switching between JS and TS for most programmers is not as simple as for me jumping between different Lisp dialects.
I'm not some indentured servant of one particular programming language, your favorite bits of syntactic sugar and "design patterns" made for one particular PL don't amaze me, don't annoy me, don't make me feel bad or good, I simply don't care. I just want to build shit, and I want it to work. I'm sure if there's an actual God, and he had to explain the universe in written form, it would be in homoiconic scripture - anything, yes, just about anything can be explained in functions, neatly wrapped between parentheses, anything beyond that is fluff made by human pride, simplicity requires less not more.
git-auto-commit-mode exists, try it.
So for me it would be: everything that makes Lisp programming easier, like:
- Use a Lisp implementation that's not tied to the editor.
- Slime/Sly + Quicklisp functionality out of the box.
- Integrated syntax awareness, preferably "syntax directed" for programming.
There is more, but it'll be obvious (like updated defaults and looks) unless you want to make an outright clone, or at least a direct replacement option, I wonder if that's what you mean: "rewriting Emacs" seems to suggest it is.
It's difficult. These big old projects like Emacs, and Lisp itself, have both succeeded and failed. There are features that made them last decades and others that made them stop attracting new users. How to capture the appealing parts without reproducing the quirks?
I’m not totally sure what I’d do. The semantics of multithreaded or async alteration of buffers are not easy and so, even though they would be great in many ways, might make simple customisation just too painful.
1.https://multicians.org/mepap.html
I'd like to eventually write something like this, there are a lot of things it would enable that you just can't do with emacs. It would be an emacs killer if implemented well, but it would also open up a whole new set of possibilities.
I don't know how far I'd get just working on it on my free time, which is competing for time with other projects. I'm looking for funding for these sorts of projects. If anyone reading this is an investor and interested in funding this sort of thing, please reach out.
If I could have Emacs with Acme-style window management, that'd be perfect
see https://www.masteringemacs.org/article/demystifying-emacs-wi... for more information.
he goes by the moniker 'prot' and has tons of very very good emacs information (both on his website, and youtube). always worthwhile to check them out !
as someone would say, if you like that kind of thing, this the is kind of thing you will like :o)
Vim feels like working on a moodboard while Emacs is more a study desk.
https://youtu.be/1-UIzYPn38s - Emacs: control where buffers are displayed (the 'display-buffer-alist')
This needs dedicated Prominenz
- make dired more usable like a normal file manager. opening a file with the associated program that would persist after emacs closes should be its primary feature. ideally i want something like a mix of ranger/lf with dired
- make it have fully-featured terminal, not dumb terminal. make it easy to open lots of terminal windows. add a way to change terminal directory with fido or dired
- make working with ssh not so horribly laggy
1. You can already define what program opens a file in dired. You could even use detach it from the Emacs process so it stays open when Emacs closes.
2 we already have vterm, which has all the features you described.
3. There are ways to make this better. I am actually in the process of writing a blog post about working efficiently over tramp.
For dired I do have my bindings (one for xdg-open on a single file, another for custom command on a bunch of files).
And scripting with JS/TypeScript. Kind of like emacs-ng attempted (https://github.com/emacs-ng/emacs-ng/)
That is, rewrites can work sometimes. You typically need someone who was involved in the last two for it to work, though.
If you haven't written it once, you have no real idea on any compromises that were made.
If you haven't tried to do it without a compromise, you don't know which compromises were unexpectedly vital.
The bad news is that I don't currently have enough free energy to help the remacs nor emacs-ng projects, but I am glad they exist
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?
This is a challenging question, it's difficult to answer in a short few sentences. One practical example that immediately comes to mind is the advising system of Emacs, where you can modify specific parts of any given function, which isn't easily achievable with Python.
In a Lisp REPL, you can modify the behavior of the REPL itself on the fly, e.g. advising it to print the execution time of each expression sent to the REPL. The homoiconic nature of Lisp allows us to treat the REPL's evaluation function as data, modify it, and immediately see the results. This level of runtime modification of language constructs is not possible in Python's REPL.
You can get very specific and start challenging that statement. We can talk about bytecode execution, and how you'd need to modify the bytecode at runtime or alter the interpreter's execution loop, or Python's function object structure, or method resolution order. We can talk about descriptor protocol which handles method binding, we can speculate about JIT complications, thread safety, garbage collection, etc. At the end, it all boils down to homoiconicity. The homoiconic nature of Lisp - Code As Data, Uniform representation, Meta-circular Evaluator, etc., all that makes the difference for the things that aren't realistically achievable in non-Lisp languages.
That opens up many interesting practical possibilities, like creating interesting DSLs with minimal syntactic overhead and runtime efficiency.
People love their favorite programming languages for their specific features. They get used to them, it's a matter of familiarity, they get attached to their language of choice. Almost every language book offers you some unprecedented magic with their language. And often programmers look at Lisp as just another programming language, missing the main point about Lisp, which is not one concrete language implementation but the idea as a whole.
Learning Lisp offers something fundamentally different. It's not just about acquiring a new syntax or set of features, but about gaining a new perspective on programming itself. Lisp provides insights into the nature of code and computation that are hard to fully grasp in other languages. The benefit of learning Lisp isn't necessarily in using it for every project, but in how it reshapes your thinking about programming. It can make you a better programmer in any language by deepening your understanding of abstraction, metaprogramming, and the relationship between code and data. Many concepts that originated in Lisp have influenced modern languages. Understanding Lisp can help you appreciate and more effectively use features in other languages that were inspired by Lisp, and that is a pretty much every PL in the TIOBE list.
But I think we can find a lot of agreement around launch speeds, latency, typography and similar.
Make it Programming Language Macros, PLMACS. Kind of life a POSIXs standard. Or the Truffle framework.
You can have multiple different source blocks in a single Org-mode document. All in different languages, and they can be passing results between one another. e.g., you can run a piece of bash that runs curl, then send the results of it to Python block, where it calculates something, then to Javascript block that uses some npm package and and then send the results to a SQL block that queries a database and generates a report.
I’m not sure i’d change the scripting language, despite all of its shortcomings it has proven itself way more than enough.
Maybe better concurrency?
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 popular javascript or ruby etc. mode and then add a couple of our own plugins on top.
Add some system that suggests hotkeys based on usage. If I hit l 20 times instead of just hitting f’ to get to the end of the line show a popup. Gamify the key maps and suggest key maps and features even from my plugins.
Instead of having a package manager for your editor just use homebrew and integrate it deeply into the editor.
So I wish the compilation would just be done once in somebody else's pipeline not in every client.
https://coredumped.dev/2023/08/09/text-showdown-gap-buffers-...
Their version of Lisp is clearly not suited for any large-scale development. (This trickles down hard into user experience, i.e., lack of parallelism or multithreading.)
Is this so obvious as to go without examples? I'm no Emacs power user, nor even really an Emacs user, but it certainly conflicts with my understanding of core Emacs.
Emacs is fine, but buggy as hell.
That kind of took 180 turn on that one.Ship is fine, but leaks as hell.
I think this misconception comes from the fact that (1) people often compare emacs and vim, and (2) vim is usually used in the terminal. But emacs and vim are really categorically different things so I think the “emacs vs. vim” meme kinda doesn’t make sense.
I think of VSCode as “Emacs, but JavaScript instead of Elisp.” That’s one thing I would not choose, in spite of the good things VSCode brings to the table.
What I meant is that the runtime is arbitrarily extensible at runtime.
But I don't assume that people actually do what you describe.
For those that downvote me, worth it.
The most realistic future is that emacs begins shipping with a self-shredding feature. C-h s
If someone had built a passenger plane with vertical take-off/landing capability, a mere accidental feature of the aircraft that nobody was even supposed to use, I would still respect the heck out of it because the mere presence of it would be proof of ingenious engineering. If you think that "VI is a superior editor than Emacs", I'm afraid you still have a shallow understanding of both.
Thank you for your long and thoughtful prose, so fitting for an emacs user. One day, when you value productivity, might I suggest VI.
Are you hinting at the fact that I used Emacs to help me write that? Sure I did. Why wouldn't I use Emacs for writing, if all the tools I need are at my fingertips? I have a thesaurus, spellchecking, Google Translate and search, dictionaries, etymology lookup, word counter, Flesch-Kincaid reading ease tester, ChatGPT, Anthropic and other models, dictation, formatter, and many more. Why would anyone ever exposed to that power willingly part with it?
> One day, when you value productivity, might I suggest
What point of "I'm saying this with confidence of a die-hard vimmer" was unclear? I already use both Emacs and Vim - they serve different purpose for me. And trust, me if YOU value productivity, one day you may wake up with realization - Emacs actually vims better than Vim.
Nay, quite the opposite; I scrolled down specifically looking for comments like these, because I knew they'd be here. Kind of comforting, really.
Emacs has an amazingly nice editor, especially for writing in plain language. It even supports right-to-left languages and things like Sanskrit. There are frequent posts in /r/emacs about using it for writing. Many novelists use Emacs for writing, some of them are well-known names - Cory Doctorow, Neal Stephenson, Vernor Vinge, Charles Stross, et al.
There are a number of nice packages that help you with writing - spellchecking, thesaurus, dictionaries, translation, definition and etymology lookup, LLM integration, export capabilities, distraction-free modes, various text manipulation tools and more.
The joke that Emacs is an operating system that simply needs a decent editor has not aged well. It's not even funny in the slightest; it's laughable in the face of the joke teller, telling more about them than Emacs and its editing capabilities.
---
That's what using X instead of Lisp to make "a better Emacs" sounds like, okay? Emacs is a Lisp-machine, it's built on top of Lisp, it needs Lisp to be Emacs. Otherwise it wouldn't be Emacs. Like at all. Don't be stupid, stop saying stupid shit like "python instead of lisp"...
Can you imagine people enjoying the user experience of Emacs while simultaneously preferring languages that are not Lisp?
It's not "for me", it is what it is. Emacs first and foremost is a Lisp machine, with a text-editor built into it, not the other way around, it's not a text-editor that uses Lisp as its configuration language.
"user experience of Emacs" is to be able to send any expression and sub-expression without any preceding ceremony directly to the REPL. Everything what Emacs does stems from that. No, Python doesn't have the same REPL. Every single stage of it in Python is different. Lisp's Read, Eval, Print, Loop - they all have slightest differences. Those differences are possible because of Lisp's homoiconic nature. Because of that you get Lisp macros, because of that you get advising functions, because of that you can do source blocks in Org-mode that can interact with and modify their own execution environment. Lisp's homoiconicity allows code to be treated as data and vice versa, enabling powerful metaprogramming capabilities. This means you can:
1. Manipulate code at runtime
2. Create domain-specific languages easily
3. Extend the language itself
In Org-mode, this translates to source blocks that can:
1. Dynamically generate and execute code
2. Modify their own content or other blocks' content
3. Interact with the Emacs environment seamlessly
This level of flexibility and power isn't achievable in Python's REPL due to its more rigid separation between code and data. While Python is highly versatile, it lacks the deep introspection and self-modifying capabilities that Lisp's homoiconic nature provides, making Lisp uniquely suited for certain advanced metaprogramming tasks and interactive development paradigms.
So the bottom line is: you can imagine really hard, but it would remain just an imagination, if you want to build something like Emacs - a REPL that has a built-in text editor, you need a Lisp, because non-homoiconic languages DO NOT HAVE exactly same REPLs. Now, do you want me to get seriously pedantic and explain how every step in ReadEvalPrintLoop differs in Lisp and Python?
Maybe it's just personal preference, since I think it's easier for me to think in python over lisp (which I've known for longer, but I still fumble through)
I do think python would make emacs more accessible to a wider audience.
It would not be Emacs anymore. Emacs is specifically tied to Lisp. Emacs is not a text editor that uses Lisp as the configuration language. Emacs is a Lisp machine that has a text editor built into it.
An "Emacs-like" editor built on Python might be interesting, but it wouldn't be a "better Emacs" or even "like Emacs", it would be a completely different thing.
You may dislike Lisp, you may even hate Lisp, but the fact remains unchanged - there is an emerging class of applications that is significantly more difficult to build around non-homoiconic languages. Emacs is one of them. Stop fetishizing your favorite programming language as the quintessence of Emacs. The best one can do is to build a compiler/transpiler to spit out Lisp code, and people have tried that. Yet somehow, in over forty years nobody has succeeded in dethroning Elisp from ruling Emacs.
GNU Emacs is tied to Elisp. But Emacs is a much wider family of editors written in a multitude of languages.
> Yet somehow, in over forty years nobody has succeeded in dethroning Elisp from ruling Emacs
That might have several reason. Maybe few people are interested to reimplement GNU Emacs in a different language. Like nobody has succeeded in dethroning C from the Linux kernel, using Lisp.
We're not talking here about a mere text editor, we're discussing a Lisp machine with level of extensibility and programmability deeply ingrained into its design, something that Vim or Sublime or any other traditional text editor can never achieve.
I don't like those languages, and I have just as much right to say that as the people who don't like Lisp.
- What? Okay, so fruits, berries?
- No, no, no fruits either.
- Hmm... what about croutons, nuts, maybe sunflower seeds?
- No, just use meat. I like meat. Just make it with a bunch of meat pieces, alright?
- Well, that is not a salad...
> Not using lisp
Don't you folks realize the imbecility of such statements? Emacs is a Lisp machine that allows writing and loading custom extensions based on Lisp! This level of extensibility and programmability is so deeply ingrained into Emacs, specifically because it revolves around Lisp. Emacs wouldn't be possible without Lisp.
I sometimes think using lisp for a language is a little like trying to implement comments within json data.
Emacs just cannot be Emacs without Lisp. Emacs is a Lisp machine; it is tightly integrated with Lisp and needs Lisp to operate. Lisp is at its core principal model.
There are a number of different types of applications that are significantly more difficult to achieve with a non-homoiconic language; check out Hyperfiddle/Electric, there are some videos with demos. Why do you think there were so many attempts to re-create something like Org-mode, yet none of them were hugely successful?
For starters - the Lisp REPL has some significant differences; it just doesn't work the same way as a REPL in, e.g., Python. In Lisp, you can send any piece of code without any prelude or ceremony directly to the REPL. That REPL instance can even be on some remote computer, like a spacecraft millions of miles away (I'm not making up this shit, NASA did it at some point)
Anyway, Emacs is Emacs because of Lisp, not because someone on a whim decided to use Lisp instead of, I dunno, Pascal. Trying to build Emacs on top of some non-Lispy language is futile. It won't be Emacs. Sure, it might be to a certain degree even better, but it won't be even "like Emacs".
Most developers do not like writing Lisp. That's just a fact, slamming the downvote button won't change it. I am not among those developers, I like writing Lisp, but most, flatly put, do not.
So by choosing Scheme you are competing with a remarkable number of little-used editors which can be extended in Scheme or Common Lisp, as well as Emacs, far and away the top dog in the extensible-in-Lisp-editor niche. Neovim has achieved the best of both worlds, because it can be extended in a rather nice Lisp, and also in Lua, which, while some find the quirks of the language annoying, is at least Algolic in structure, matching the mode of thinking and writing used by the vast majority of devs.
No it has not. Fennel doesn't have the same level of integration into Neovim, like Elisp has in Emacs. Emacs is essentially a Lisp interpreter with a text editor built on top of it. This tight coupling allows Elisp to interact with and modify every aspect of Emacs, providing a level of customization and extensibility that is difficult to replicate with external languages.
While Neovim's approach with Lua and Fennel is commendable, it is unlikely that these languages will achieve the same level of seamless integration as Elisp within Emacs.
I was doing some API testing today, I pressed a key, then a snippet expansion system added something like this into my notes:
#+begin_src http
GET http://localhost:5003/api/health
#+end_src
I ran the snippet, it sent the request and it failed.I realized that I needed a token. It is stored in an env var - not very secure, but it's okay - I'm not testing the prod endpoint. I just had to change the header into this:
#+begin_src http :var token=(shell-command-to-string "echo $MY_TOKEN")
GET http://localhost:5003/api/health
Authorization: Bearer ${token}
#+end_src
I ran that, and Emacs picked up the env-var, fed that into the snippet, sent http request, got me some results. Then, I changed the endpoint to get some more data, I realized that I would like to examine it closer. I could've done this in Python, Javascript, any other language, even Elisp, but I know Clojure, it's good for data manipulation - so I chose that. I just had to feed the http request results to another block in Clojure. I spun up a Clojure REPL, went through the data, looked at the results, typed some Clojure data manipulation functions, right there where my notes were, ran them against the data, added some more notes - documenting my findings.I've tested some more endpoints, got some unfamiliar http error codes, so I just typed directly in my notes "RFC 2616", Emacs was smart enough to recognize what that was and it opened the RFC document, where I searched for the error code, read about it, refreshing my knowledge.
Then I found the Jira ticket number in my yesterday's notes, copied over to my notes of today - Org-mode has a nice way of organizing daily notes in so-called date-trees. It's just a plain string - "TDL-26478", and once again, Emacs was smart enough to know what that was, I was able to read the description of the Jira ticket, without switching to the browser, without opening any pages, right there, from where I was composing my notes.
And this is all within less than an hour. I was able to send http requests, analyze results, study relevant RFC document, work with Jira, all that while taking extensive notes, without opening a single web-page, without typing a single command in the terminal, all that done inside Emacs. Emacs basically within less than an hour in a single window was able to substitute for me - a note taking app like Obsidian or Notion; API client like Postman; Interactive computing platform like Jupyter; Project management client for Jira; RFC documentation site; Web-browser and the Terminal app. So tell, me which one of any of these activities do you normally do in Neovim? And btw, this is not even remotely "esoteric" stuff I do in Emacs. This is just an ordinary Tuesday for me.
I use both Vim and Emacs daily, and while your observation about Emacs generally being slower than Vim isn't incorrect, it doesn't necessarily make Vim a better all-purpose tool for everything. Emacs isn't either, for certain things, Vim is indeed excellent.
I suggest you reconsider your perspective on Emacs users as mere dorks who misunderstand Vim or are too lazy to learn it. Instead, explore their motivations, question your own "cold attitude towards Lisp-like languages" - "know thy enemy", if you will. You might uncover some surprising insights. Trust me on this, from one die-hard Vimmer to another: it's never "Vim vs. Emacs for everything", it's rather "Vim or Emacs for the task at hand".
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.
That's how it sounds to me. Dismissing Lisp solely based on its syntax (that you're unfamiliar with), is equally irrational as rejecting projects that incorporate mathematical notation.