20
votes

I'm learning Emacs Lisp and I came across this decade old post saying that at some point Guile (Scheme) will replace Emacs Lisp, or Emacs will be rewritten with Guile.

https://web.archive.org/web/20081201143448/http://sanpietro.red-bean.com/guile/guile/old/3114.html

I was wondering if this is still a possibility, and if developers should be trying to write Elisp with this in mind? The original goal was for Guile to be backwards compatible with Elisp, but it seems like developing Scheme is the better choice.

6

6 Answers

8
votes

guile and emacs, again - updated Emacs src, using non-hacked Guile, 23 Aug 2009

PS: I was noticing recently that my first commit to the Emacs source tree relating to this project was on 1999-08-28, just shy of ten years ago. I'm not sure if I should celebrate or be depressed on Friday.

http://lists.gnu.org/archive/html/guile-devel/2009-08/msg00163.html

9
votes

It should be possible after Guile 2.0 is released to use Guile with Emacs. The current pre-release supports ecmascript as well as scheme and there is apparently an elisp branch also but I haven't looked into it. Once Guile fully supports elisp it shouldn't be too hard to replace the current elisp interpreter with Guile. The real question is whether or not people are going to rewrite their customizations and add-ons in scheme or just continue to use elisp. Regardless, Guile 2.0 should make the possibility of a Guile Emacs much closer to reality than any other development in the past 10 years.

9
votes

Guile 2.0.0 (released 2011-02-06) supports Emacs Lisp.

You can switch at the repl like so:

 scheme@(guile-user)> ,language elisp
 Happy hacking with Emacs Lisp!  To switch back, type `,L scheme'.
 elisp@(guile-user)> (eq 1 2)
 $1 = #nil

As to if/when someone is going to do some surgery on Emacs to extract elisp and drop in Guile-in-elisp-mode: the Guile 2.0.2 reference manual suggests this is the plan but it's not ready yet:

We hope that eventually Guile's implementation of Elisp will be good enough to replace Emacs' own implementation of Elisp.

2
votes

I wouldn't worry too much about it. There are a couple of projects to use Guile with Emacs, but I sense that they're not mainline supported. As one of the developers of one of the projects observed, no one will switch unless all their existing elisp runs flawlessly in the new engine, which is a pretty tall task.

Not that it will never happen, it's just been 'in the clouds' for a few years.

2
votes

Using a VM like parrot seems more interesting for the future than Guile as Parrot VM can handle many different dynamic languages and each language can reuse what has been developed in another language.

The work left to be done is :

  • adding emacs low-level concepts and functions to Parrot VM (basic elisp types like the buffer type, window, frame...)
  • creating an elisp language port to Parrot VM.

With such functionalities you could have all legacy elisp code running on Parrot VM without any porting issues, and new code could be developed and reused by any language supported by Parrot VM.