
Guilemacs – Emacs with Guile Scheme - MintelIE
https://www.emacswiki.org/emacs/GuileEmacs
======
aijony
As a user of both Guile and Emacs this project has always intrigued me, but I
think people arguing for speed, multitasking, or configuring Emacs in Scheme
or Javascript are missing the point. Guile Emacs represents an ideal where GNU
projects share a common library that all benefit from shared improvements. For
example, if Guile gets native compilation, Guile Emacs, Guix, and any other
Guile project gets native compilation. I would never write my Emacs config in
Scheme, but I wouldn't hesitate to call a Scheme library from Emacs, or an
Elisp library from a Guile project. Guile Emacs would be a huge step unifying
all of these separate GNU projects from both a technical and social point of
view.

~~~
smabie
I agree, though Emacs does support native compilation at the moment (it's
still a work in progress though). It would have been nice if the Guile stuff
go merged, but I think that ship has sailed and we should just embrace the
native compiler included in Emacs.

------
emmanueloga_
"Guile-based Emacs is a branch of GNU Emacs that replaces Emacs’s own
EmacsLisp engine with the Elisp compiler of Guile. It does not attempt to
remove Elisp. One advantage is that Elisp will potentially execute faster"

Another initiative was posted here recently [1].

"GNU Emacs can currently execute Elisp code either interpreted or byte-
interpreted after it has been compiled to byte-code ... exploiting libgccjit
to achieve code generation using the GNU Compiler Collection (GCC)
infrastructure. ... Though still a work in progress ... Native compiled Elisp
shows an increase of performance ranging from 2.3x up to 42x with respect to
the equivalent byte-code"

1 :
[https://www.reddit.com/r/emacs/comments/g9vdd0/bringing_gnu_...](https://www.reddit.com/r/emacs/comments/g9vdd0/bringing_gnu_emacs_to_native_code_at_the_european/)

------
WhatIsDukkha
Watching Tom Tromey's talk on the future of Emacs is a better use of your time
I suspect -

[https://irreal.org/blog/?p=8687](https://irreal.org/blog/?p=8687)

He addresses many of the "obvious" ideas many of the casuals that appear in
these hn threads have.

~~~
aijony
Funny enough, if you rewrite all of Emacs in Elisp that would superficially
seem to make Guile Emacs easier to implement. I wouldn't be surprised if by
that time Guile had native compilation and an even better Elisp
implementation. Ironically, it would defeat the original intention of Guile
extending C programs that was inspired by Emacs, but even the Guile community
is starting to lean towards Scheme-only programs with some FFI akin to Tom's
ideas.

~~~
MintelIE
Maybe if you use Guile to rewrite the parts of Emacs that are currently
written in C, and go with the dynamic translation idea currently used in
Guilemacs you could achieve the same goal. Then you could rewrite Emacs in
Guile at your leisure, or not, retaining elisp compatibility for historical
and practical reasons alike.

------
smabie
If one is looking to improve Emacs performance, I would recommend checking out
gccemacs
[https://akrl.sdf.org/gccemacs.html](https://akrl.sdf.org/gccemacs.html)
insteald, as guilemacs has stalled. gccemacs has been merged into the main
emacs branch and works by compiling Elisp into dynamically loadable binaries.
The performance speedups are very promising, with up to 30x speed improvements
over standard byte code. I've been using it as my default emacs and it's been
working very well. No crashes and Emacs is finally not slow! Now all Emacs
needs is preemptive multi-threading!

------
messe
I don't do much lisping or scheming these days, but my experience of Guile has
be nothing but exemplary. I'm a VIM user, but I would definitely give emacs
another shot if scripting it in scheme was an option (with evil-mode
definitely; no way am I giving up modal editing).

> It’s best to call it “GuileEmacs” or “Guile/Emacs” or such to make it clear
> that it’s still GNU Emacs.

No love for Guile+Emacs?

~~~
rcthompson
I'm sure one of them will catch on just like GNU/Linux has.

~~~
openfuture
This is about as correct as telling your wife that your beard will grow on her
like it grew on you.

------
sillysaurusx
You can also write your own dialect of lisp within elisp, too. I ported
Lumen[1] to emacs:
[https://github.com/shawwn/y/blob/abcf6f4406178880390308ff0b7...](https://github.com/shawwn/y/blob/abcf6f4406178880390308ff0b782a5ed516c688/y.el#L251-L263)

    
    
      (define-global cut (x &optional from upto)
        (with l (dup x)
          (let (j 0
                i (if (or (nil? from) (< from 0)) 0 from)
                n (\# x)
                upto (if (or (nil? upto) (> upto n)) n upto))
            (while (< i upto)
              (set (at l j) (at x i))
              (inc i)
              (inc j))
            (each (k v) x
              (unless (number? k)
                (set (get l k) v))))))
    

The destructuring LET is so nice.

Emacs' reader can also be completely overridden by user code. I used this
technique to port pg's Arc to elisp:
[https://repl.it/repls/UnluckySturdyCharactercode#main.el](https://repl.it/repls/UnluckySturdyCharactercode#main.el)

(If you click "run" and type #\a you'll notice you get "a" rather than a
syntax error.)

[1] Lumen lisp: [https://github.com/sctb/lumen](https://github.com/sctb/lumen)

------
chx
This really needs a (2016) in the title. The recent edit (not even edits) adds
little to nothing and the last commit was in 2015.

------
xvilka
With Guile 3.0 released recently, that is way faster[1] than before, it looks
even more interesting. The only problem is that many distributions still
didn't update yet[2].

[1] [https://www.gnu.org/software/guile/news/gnu-
guile-300-releas...](https://www.gnu.org/software/guile/news/gnu-
guile-300-released.html)

[2]
[https://repology.org/project/guile/versions](https://repology.org/project/guile/versions)

------
the_duke
I was under the impression that this effort has been stalled for 5+ years.

Is that incorrect?

~~~
stevekemp
This is a stalled project, interesting but stalled.

There are changes happening elsewhere, for example the obligatory rust mashup:

[https://github.com/remacs/remacs](https://github.com/remacs/remacs)

gccemacs is probably the most interesting recent development:

[https://akrl.sdf.org/gccemacs.html](https://akrl.sdf.org/gccemacs.html)

------
emmanueloga_
Surprisingly I found Scheme support in Emacs underwhelming (disclaimer: I'm a
Windows user). The best package for Scheme in Emacs seems to be Geiser [1],
but it seems pretty basic when compared with Slime [2]. Perhaps Geiser+Guile
is a different story if running on Unix, but Slime on Windows just works, so
that's a plus for Common Lisp :-).

1: [https://www.nongnu.org/geiser/](https://www.nongnu.org/geiser/)

2: [https://common-lisp.net/project/slime/](https://common-
lisp.net/project/slime/)

~~~
fiddlerwoaroof
My general sense is that the scheme community doesn’t have the “live system”
culture the way the Common Lisp and Clojure communities do: schemes generally
seem to deemphasize things like live code updates in favor of a more “batch”
compiling strategy: I’ve especially noticed this when talking to people in the
Racket community, but my general sense is that Racket inherited this from
scheme.

~~~
dang
I'm not sure about Schemes in general but you've described my experience of
Racket precisely. It's somehow a completely different feel. For me the 'live
system' Lisp spirit is fluid and always makes things modifiable and bend to
the will of the programmer. The 'batch' sensibility thwarts this. It shows up
particularly in module systems that force you to jump through hoops that
aren't worth it and that compound into difficulty upon difficulty. In this
respect the Common Lisp package system has always struck me as a miracle of
design: it allows disparate systems to compose, while allowing the programmer
full access to whatever they want to do. You just sometimes need to type an
extra colon—a small price to pay.

------
MintelIE
A couple points to note: This works by dynamically translating elisp to Guile
Scheme, which is crucial to ensuring that decades worth of elisp will work
without change. However, in Guilemacs, one can use Scheme as well as el as
extension languages.

Also while it works, it's quite slow at this point in time and, unlike Emacs
which rarely if ever crashes, Guilemacs can and will crash.

