Using Guile for Emacs
lwn.net
lwn.net
[0] https://www.gnu.org/software/guile/manual/html_node/Prompts....
https://www.youtube.com/watch?v=yjC162DnsKI&t=594s
for me the most interesting point, guile will allow emacs to be more lispy, replace c code with guile code and integrate with CLISP and CLISP libraries
I on the other hand, am very familiar with guile, I don't particularly care for elisp, and I would like to be able to customise my editor more comfortably. For me this is great.
In my opinion and from my POV, Elisp is completely fine - no need to amend or replace it. The last thing I'd like is to mix yet another language into my config (already have to call out to shell and AppleScript).
Now I don't know how annoying Elisp is for package authors, or maybe there's a Guile/Scheme library somewhere out there that Emacs could desperately use.
The problems are IMHO elsewhere, and the main one is that Emacs feels antiquated next to literally any text editor conceived in the past 30+ years. The defaults are awful - most of my config is just fixing papercuts, like adding support for light/dark mode, finding a reasonable font and applying text size consistently, locating the correct LSP executable, or following platform conventions for copy/paste (all across Linux, OpenBSD, and macOS).
I would really like it if Magit was a standalone program, rather than an Emacs package, so that I could just switch to a more reasonable editor.
It isn't the reason for Guile Emacs, but there is in fact a library Emacs could quite desperately use: fibers (<https://github.com/wingo/fibers>). The Emacs concurrency story is about as bad as you could expect from a 40+ year old application.
And what about Org, Org-Roam, Anki-editor, pdf-tools and org-noter, Eshell, gptel and chatgpt-shell, Transient, Vertico, Consult and Embark, Dired, Notmuch and mu4e, elfeed and elfeed-tube, consult-omni, gh-notify and code-review.el and many other nice things?
Sure, Emacs has many deficiencies - nothing is ever perfect. I too, would love to find something better, where those deficiencies are not. But tell me please, which alternative does allow you to do any of these things "reasonably" well?
Tell me, in which editor I can be taking my notes while also sending http requests, and queries to an sql database, while transforming the results in a higher-order language and then spitting out the data into a chart? Where I can also mark things in my notes for spaced repetition, without moving them anywhere, without converting anything. Where my notes can have LaTeX embedded formulas. Where I can type 'RFC 7230' in plain text and my editor would intelligently know what that is and allow me to browse the relevant document in-place. Where I can open any pdf and it would automatically locate my annotated notes. Where I can control the playback of any video - YouTube or whatnot, pausing it for note-taking, grabbing entire paragraphs of its transcript and putting them into my notes.
Tell me, which other editor has the notion of 'indirect buffers', where you can modify the same file working with it as if you're editing multiple files - where I can edit my code comments, treating them as if they are in markdown? Where you can freely edit your directory structure, using all editor features like multi-cursors and other things?
Tell me, which other editor allows me to search things in so many ways. Where else can I type a single query once and it sends out requests to Google, DuckDuckGo, Wikipedia, my browser history, GitHub, etc. and consolidates the results into a single buffer?
Bottom line: there just doesn't exist a reasonable option that is better than Emacs in the sense that it is free from its deficiencies and yet so versatile and powerful.
BTW, those wanting an Emacs, but with Common Lisp rather than elisp can check out the lem-project on Github.
https://protesilaos.com/codelog/2024-11-28-basic-emacs-confi...
Also, a small point, you'll be thrilled to hear that an excellent "light/dark mode" is included in stock emacs since the modus-themes were beamed up into the mothership, which was several years ago at this stage.
Just leave elisp alone. I see nothing but grief and churn in this direction.
With my recent switch to neovim, I'd say that neovim is a lot better than emacs for me. I used kickstart.nvim as a launching point to base my config off of, and it's incredible! Neogit is a port of magit to neovim and while it's not quite as feature complete as magit, it's close enough when combined with DiffView.nvim and gitsigns.
Lua is a game changer versus vimscript and I'd say now that the gap in packages has been narrowed greatly and you can turn neovim into a pretty equivalently powerful dev environment to Emacs, while having vastly better performance.
to be honest mostly this is Spacemacs' fault. I left Spacemacs around the time you adopted it and I was shocked at how much more performant Emacs was without all the crap in Spacemacs' layers system
I haven't declared init.el bankruptcy since then, either.
> would really like it if Magit was a standalone program
check out lazygit
Magit (for me) has so much value _because_ it is part of Emacs , where I edit all my code.
Same. I'll never ever understand people saying "I use Emacs but only because of org-mode" or "I use Emacs but only because of Magit".
I use for Emacs for many things, hence org-mode and Magit have a lot of value to me. But they're not that amazing in themselves as to put up with Emacs only for one of these two.
Emacs is quite something: I don't think it's reasonable to use if only for either org-mode or Magit. You risk feeling bitter about it like GP.
But I’m really more a Vim guy. I’ve used it since the mid-2000s, still regularly use it, and all the keybindings and workflows just make sense to me. I even like vim9script as a language (I prefer it over Lua, but I do for sure like Elisp better). If it wasn’t for Org-mode I’d still be using Vim full-time.
This describes virtually every editor on earth. In fact because macos leans so heavily on readline input, emacs comes with far more compatibility with native keybindings than VSCode does. IntelliJ is a downright horror show in this regard.
The runtime environment of emacs is definitely showing its age. Freezes and long pauses of non-interactivity are pretty common, although they do get fixed, new ones are regularly introduced. Separating the language fundamentals from the editor itself seems to show promise in opening up alternatives that allow competing with more modern editors on more even footing.
The ubiquity of readline is a bit of a myth. What happened was that Bash (thus Readline) and NeXT (thus MacOS) independently copied Emacs keybindings, where Emacs predates both. But the Mac GUI doesn’t use the Readline library, and differ in some points (e.g. M-f works in Readline but not MacOS). Moreover, it seems a lot of people think Readline is used everywhere in the CLI, but many popular interpreters use other libraries. For instance, Bash uses Readline but Zsh and Fish uses their own things. Python has used Readline up until now, but is moving away in 3.13. IPython switched from Readline to prompt_toolkit many years ago. Readline was also not the first shell to adopt Emacs keybindings, it was preceded by Ksh IIRC.
I have nothing against Readline, and I understand where you’re coming from since this is often repeated online for some reason. I just want to point out that it’s actually emacs keybindings and not readline keybindings that is the correct term here :)
I hadn't even noticed that zsh and fish used something other than readline. To me, they effectively are using readline as that's the name for the functionality that's fulfilled.
I don't really give a damn what they're called or why they exist, so I'll happily call them emacs bindings if that makes more sense to you.
That’s fair. But on the other hand they also don’t implement any of the Readline keybindings that are not in Emacs, like for example C-w and C-u to delete the last word and line, respectively.
> I hadn't even noticed that zsh and fish used something other than readline. To me, they effectively are using readline as that's the name for the functionality that's fulfilled.
IMO, that’s like calling Vim and Emacs for “TextEdit” because that’s what they do. I see the argument, but it is confusing.
Readline is one particular library, and it is relevant to many users like me whether it’s used or not. Many alternatives (as used by Fish and IPython for example) have better support for modern features like multi-line editing and syntax highlighting. Conversely, if MacOS actually used libreadline, I should have been able to enable Vi mode in .inputrc and get Vi keybindings in every MacOS text field, which I think many Mac users would want. But alas, MacOS ignores .inputrc, although there is a somewhat equivalent DefaultKeyBinding.dict. If you customize your .inputrc it also quickly becomes apparent that Fish and Zsh for example ignore your Readline settings.
Not least, because Readline also supports Vi keybindings (`set editing-mode vi` in `.inputrc`), it just defaults to Emacs keybindings (equivalent to `set editing-mode emacs`).
Always curious with folks who request this whether they've tried `tig` (https://jonas.github.io/tig/)?
Not sure what part of Magit you're looking for, but the basic workflow of jumping to changes and interactive staging works just as well to me in `tig` (with Vim) as Magit.
EDIT: It does the things it does well, but it's not even close.
I think you can make the case that editor integration with Git is objectively better for the use cases I listed, but a lot of what Magit does is just alternative UI to what Git CLI provides, but I'd have a hard time making the case that either is better than the other, just different.
I always assume when people are asking for Magit in other editors, they just want the parts that are objectively better than Git CLI, but I'm not really sure which is why I asked the question.
Curious about light/dark mode, what does it do more than loading a theme? something like circadian.el? maybe it's because I hide menu-bar/tool-bar/scrollbars by default but `M-x load-theme modus-operandi` is all I need for whenever a room is too bright or a colleague complains about my dark theme.
What really bothers me is the sluggish performance, especially when handling large numbers of buffers or even searching large files. Pretty sure fussing with Elisp is not going to fix that.
It's there.
M-x invert-face
Then, type "default"Also, checkout M-x customize-themes for some other decent built-in themes.
For me at least it took a few weeks initially to get a set up I liked but then have barely touched it in ~15 years. I suspect "better defaults" won't happen because it's not a continuing problem users have - like maybe you think about it when you're in the initial setup, but then it becomes less important to any developers.
It's an advanced tool, and typically advanced tools don't come out of the box ready to go.
As the plethora of startup kits and re-configurations show, it's also not something people can agree what the right thing (TM) is.
Almost everything can be converted to a text workflow and emacs has a lot of features for text based interfaces.
You can't even select multi-line text or use ctrl-c to copy text. It's not all that far from being limited to A/B/start/select/d-pad.
Actually, I'm not sure if there are any "major" issues... Development has been phenomenally good the last few years, the maintainers have been brilliant. There's a steady stream of contributors, new cool stuff (LSP support, native compilation, etc), improvements are happening regularly.
In summary, Emacs seems to be rock solid, and the quaint little splash screen when you run it for the first time does not seem close to keeping people away! Maybe we need to uglify it :)
But sure, yeah, prettier defaults, why not. I'm not convinced it'd suddenly get more people using Emacs, though, as Doom Emacs already exists, and that's very pretty and well-documented and modern-looking and so on.
It's my understanding it would be a significant speed improvement but the amount of work and the - ahem - stallman factor are big roadblocks.
huh?!?
he was and is actually supporter of guile-emacs
rms is a blocker of CL emacs, which I would like to see (and use). Relative to the guile, CL implementations are of great quality, rich set of libraries, ...
It's not like the pool of guile developers is much larger than the pool of elisp developers.
And guile has gotten worse for users in the 3.x series compared to the 2.x series.
This is coming from someone whose used it since 1.6 and gave up around 3.0.4 moving to racket.
(define (add-2 x)
(+ x 2))
(add-2 z)
Where the result is an error without the possibility to provide a value. Compared to in SBCL: (defun add-2 (x)
(+ x 2))
(add-2 z)
Where we are dropped in the debugger with the following possible restarts:* Continue, where we retry the operation (best to first define z),
* Use Value, where we can provide a value to use,
* Store Value, where we can set z to a value and use the value,
* Abort, where we just cancel the operation.
There's also setf expansions, so in SBCL we can do, for example:
(setf (car some-pair) 3)
Whereas in Racket we can't do the equivalent: (set! (car some-pair) 3)From the article "Richard Stallman is not a fan of Common Lisp; rewriting Emacs using it is not likely to go far." My understanding is his preferences have a strong influence on emacs direction, which of course is well deserved, but he can be stubborn about things. I used "stallman factor" because it's not easy to sum up, as his strong opinions and influence on the project are both not bad things (even when I disagree with him I feel it's important to have someone like him) but they do prevent some avenues for improvement. Happy to be wrong about this.
That would be a revolutionary development, not that Guile garbage
Response from @ramin_hal9001@fe.disroot.org
@ram535 thanks for asking! The goal for both projects are similar, but they are achieved in slightly different ways.
Gypsum is a clone written in Scheme, meaning it is software the behaves exactly like Emacs, but it is written from scratch in a new code base. In this case, it is also being written in a completely different programming language, Scheme instead of C. The larger goal is to have an Emacs that is backward compatible with GNU Emacs but is written in Scheme that runs on any R7RS standard compliant Scheme implementation. There is no C code in this project at all, it is purely Scheme. I would like to also target other compilers such as MIT Scheme, Gambit, Stklos, and possibly Chicken and Larceny as well, though this will be pretty difficult and rely on a lot of cond-expand code. The larger goal is to have an Emacs app platform that encourages the use of the Scheme language for creating applications and text editing work flows, regardless of the underlying compiler.
@lispwitch ‘s “GuileEmacs” is not a clone, but a fork of both GNU Emacs and GNU Guile, meaning it modifies the existing GNU Emacs code base and some of the Guile source base, replacing some of the C source code in GNU Emacs with other C source code from Guile. Then, the Emacs Lisp interpreter written in C is replaced with an Emacs Lisp interpreter written in Guile Scheme. This allows Emacs Lisp to be JIT compiled using Guile’s JIT compiler, and also make use of all of the Guile software ecosystem to extend Emacs. This is incredibly useful, because there is quite a lot of Guile software, including things like web servers and game engines, and soon it could all be available for use by Emacs programmers. It will probably also be production ready much sooner than my Gypsum project because it only needs to implement the core of Emacs Lisp to work. However, it relies on language features specific to Guile to achieve this, so it is not fully R7RS standards compliant, and will not work on other Scheme implementations.
Edwin is a clone of GNU Emacs version 18 written in MIT Scheme.
https://www.gnu.org/software/mit-scheme/documentation/stable...
Advice to Robin: Find something else to spend your time on because this isn't going anywhere.