unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ken Raeburn <raeburn@raeburn.org>
Cc: emacs-devel@gnu.org
Subject: Re: emacs and guile (Re: ehelp woes, or why I hate a module that I love so much)
Date: Thu, 18 Jul 2002 17:45:34 -0400	[thread overview]
Message-ID: <tx1sn2gvhfl.fsf@raeburn.org> (raw)
In-Reply-To: <vafznwq3ehv.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de> (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Wed, 17 Jul 2002 11:11:56 +0200")


> Is there a way to use Guile (Scheme?) to emulate Emacs Lisp?  I think
> somebody has written a Common Lisp module that emulates Emacs Lisp,
> but I haven't heard about Guile/Scheme.

I think as a proof of concept you could write a machine-code and
system-call emulator in Scheme, and run the current Emacs binary
including its Lisp interpreter, so, yes.  Of course, the interesting
trick is to do it more efficiently than that. :-)

People have definitely worked on it.

The Guile CVS repository contains some code that loads quite a bit of
elisp.  I haven't looked at it in a while, so I can't tell you
anything about the performance, but I think it did depend on some
extension code written in C; why, I'm not sure, but that costs some
karma points in my book.

Some XEmacs people (including one who told me he's interested in
converting XEmacs to a Scheme base, but not with Guile) are developing
techniques for doing static analysis of Lisp code to determine when
dynamic bindings can be replaced with static bindings, to enable the
generated Scheme code to be more efficient.  Their goal is (possibly
expensive) conversion of Lisp libraries into Scheme libraries, which
could then be loaded at run-time as Scheme, or compiled, whatever.

> Or is the idea to have two languages side-by-side in Emacs?  I think
> this side-by-side feature is a strong point of Guile.  But I don't
> know much about Guile, so this could be totally wrong.

If we don't have full run-time translation, we can still use the
existing interpreter, modified to work with the new shared object
representation.  In fact, that's my first goal, having the modified
Lisp interpreter run Emacs, without even having any Scheme code
running at all.  Then get Scheme going, and at least minimal
interaction between the two languages.

I think it would be a mistake to stop there.  The Guile folks have a
decent run-time byte-code generator running, and machine code
generation may be a possibility down the road.  Converting Emacs Lisp
byte codes to C should be pretty easy too, but my impression is that
Scheme lends itself better to certain kinds of optimizations.  (For
example, lexical binding means you can use C local variables instead
of setting and restoring bindings of global variables, and the C
optimizer can probably do a better job with that.)

It'll certainly be worth looking at more closely.  Will it be a
worthwhile change?  That'll depend on a lot of factors.  We may find
that Guile needs a lot of work to bring its speed up to the level we
need.  We may find its memory use to be a problem.  These and other
parts of Guile are being worked on now; it's hard to predict where
they'll stand when we're ready to look at this question.

  parent reply	other threads:[~2002-07-18 21:45 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-25 14:50 ehelp woes, or why I hate a module that I love so much Juanma Barranquero
2002-06-25 15:06 ` D. Goel
2002-06-25 15:41   ` Juanma Barranquero
2002-06-26 22:24 ` Richard Stallman
2002-06-27 17:11   ` Juanma Barranquero
2002-06-27 19:57     ` Stefan Monnier
2002-07-02 15:02       ` Juanma Barranquero
2002-07-02 15:18         ` Stefan Monnier
2002-07-02 15:50           ` Juanma Barranquero
2002-06-29  8:41     ` Richard Stallman
2002-07-02 15:15       ` Juanma Barranquero
2002-07-02 15:49         ` Eli Zaretskii
2002-07-03 11:16           ` Juanma Barranquero
2002-07-03 20:57         ` Richard Stallman
2002-07-03 21:32           ` Simon Josefsson
2002-07-04  5:09             ` Eli Zaretskii
2002-07-04  7:58           ` Juanma Barranquero
2002-07-04 10:13             ` Eli Zaretskii
2002-07-04 11:52               ` Juanma Barranquero
2002-07-06 10:38                 ` Eli Zaretskii
2002-07-04 11:02             ` Simon Josefsson
2002-07-04 12:08               ` Juanma Barranquero
2002-07-04 12:19                 ` Miles Bader
2002-07-04 13:31                   ` Juanma Barranquero
2002-07-04 14:02                   ` Simon Josefsson
2002-07-04 14:00                 ` Simon Josefsson
2002-07-04 15:20                   ` Juanma Barranquero
2002-07-17  2:58                     ` emacs and guile (Re: ehelp woes, or why I hate a module that I love so much) Ken Raeburn
2002-07-17  7:13                       ` Juanma Barranquero
2002-07-17  9:11                       ` Kai Großjohann
2002-07-18 14:54                         ` Richard Stallman
2002-07-18 21:45                         ` Ken Raeburn [this message]
2002-07-18 14:55                       ` Richard Stallman
2002-07-18 20:13                         ` Ken Raeburn
2002-07-19 13:03                           ` Andreas Schwab
2002-07-19 16:24                             ` Ken Raeburn
2002-07-19 16:54                           ` Richard Stallman
2002-07-19 17:51                             ` Ken Raeburn
2002-07-18 14:56                       ` Richard Stallman
2002-07-18 19:54                         ` Ken Raeburn
2002-07-19  4:23                           ` Stefan Monnier
2002-07-19 12:56                             ` Ken Raeburn
2002-07-19 13:34                               ` Stefan Monnier
2002-07-19 14:16                                 ` Andreas Schwab
2002-07-19 15:04                                   ` Stefan Monnier
2002-07-19 16:54                           ` Richard Stallman
2002-07-19 17:48                             ` Ken Raeburn
2002-07-19 18:25                             ` Marius Vollmer
2002-07-20  0:35                               ` Richard Stallman
2002-07-20 12:00                                 ` Marius Vollmer
2002-07-21 20:14                                   ` Richard Stallman
2002-07-19 16:54                           ` Richard Stallman
2002-07-04 19:07             ` ehelp woes, or why I hate a module that I love so much Henrik Enberg
2002-07-05  0:49               ` Juanma Barranquero
2002-07-05 11:15                 ` Per Abrahamsen
2002-07-05 10:48             ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tx1sn2gvhfl.fsf@raeburn.org \
    --to=raeburn@raeburn.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).