public inbox for guile-emacs@sourceware.org
 help / color / mirror / Atom feed
* Elisp translator work finished (for now)
@ 2002-02-08  3:53 Neil Jerram
  2002-02-11 14:38 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Jerram @ 2002-02-08  3:53 UTC (permalink / raw)
  To: Guile Development; +Cc: guile-emacs

I've now finished my currently planned work on the Emacs Lisp
translator in guile-core CVS.

It works well enough for experimentation and playing around with --
see the README file for details of what it _can_ do -- but has two
serious restrictions:

- Most Emacs Lisp primitives are not yet implemented.  In particular,
  there are no buffer-related primitives.

- Performance compares badly with Emacs.  Using a handful of
  completely unscientific tests, I found that Guile was between 2 and
  20 times slower than Emacs.  (See the comment in
  lang/elisp/example.el for details of tests and results.)

Interestingly, both these restrictions point in the same direction:
the way forward is to define the primitives by compiling a
preprocessed version of the Emacs source code, not by trying to
implement them in Scheme.  (Which, of course, is what Ken Raeburn's
project is already trying to do.)

Given this conclusion, I expect that most of the translator's Scheme
code will eventually become obsolete, replaced by bits of Emacs C
code.  Until then, though, it should have a role:

- as a guide to the Guile Emacs project on how to interface to the
  Elisp support in libguile (notably, usage of `@fop' and `@bind')

- as a proof of concept and fun thing to experiment with

- as a working translator that could help us develop our picture of
  how we want to integrate translator usage in general with the rest
  of Guile.

Comments are (of course) welcome.

Best regards,
        Neil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Elisp translator work finished (for now)
  2002-02-08  3:53 Elisp translator work finished (for now) Neil Jerram
@ 2002-02-11 14:38 ` Thien-Thi Nguyen
  2002-02-12 14:38   ` Neil Jerram
  0 siblings, 1 reply; 5+ messages in thread
From: Thien-Thi Nguyen @ 2002-02-11 14:38 UTC (permalink / raw)
  To: neil; +Cc: guile-devel, guile-emacs

   From: Neil Jerram <neil@ossau.uklinux.net>
   Date: 08 Feb 2002 11:51:50 +0000

   Comments are (of course) welcome.

this is really cool stuff!

i modified lang/elisp/base.scm `load-emacs' like so:

(defun load-emacs (&optional new-load-path)
  (message "load-path: %s" load-path)
  (cond (new-load-path
         (message "Setting load-path to: %s" new-load-path)
         (setq load-path new-load-path)))
  (message "load-path: %s" load-path)
  (scheme (read-set! keywords 'prefix))
  (message "Calling loadup.el to clothe the bare Emacs...")
  (load "loadup.el")
  (message "Guile Emacs now fully clothed"))

and then tried to write examples/lang-elisp/load-emacs (below) w/o
success; the 20.7 loadup.el is still being searched instead of what i
specified.  didn't get a chance to look further, but here's a short log
of the output:

cd /home/ttn/tmp/.tmp/examples/lang-elisp/
./load-emacs
load-path: ("/usr/share/emacs/20.7/lisp/" "/usr/share/emacs/20.7/lisp/emacs-lisp/")
Setting load-path to: ("/home/ttn/build/.gnu/emacs/lisp" "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp")
load-path: ("/home/ttn/build/.gnu/emacs/lisp" "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp")
(#<primitive-procedure eval> (#<primitive-macro! quote> (read-set! keywords (quote prefix))) #<directory (guile-user) 8083260>)
Calling loadup.el to clothe the bare Emacs...
Loading /usr/share/emacs/20.7/lisp/loadup.el...
Using load-path ("/home/ttn/build/.gnu/emacs/lisp" "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp")
ERROR: Signalling file-error with data ("Cannot open load file" "byte-run")

thi


___________________________________________
#!/bin/sh
#-*-emacs-lisp-*-
# this file is examples/lang-elisp/load-emacs so top-builddir is two levels up
exec /home/ttn/build/.gnu/guile-core/pre-inst-guile ../.. -s $0 "$@"
!#

(use-modules (lang elisp interface))
(load-emacs '("/home/ttn/build/.gnu/emacs/lisp"
              "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp"))
            
;;(princ "HELLO!\n\n\n\n\n")

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Elisp translator work finished (for now)
  2002-02-11 14:38 ` Thien-Thi Nguyen
@ 2002-02-12 14:38   ` Neil Jerram
  2002-02-12 14:59     ` Neil Jerram
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Jerram @ 2002-02-12 14:38 UTC (permalink / raw)
  To: ttn; +Cc: guile-devel, guile-emacs

>>>>> "thi" == Thien-Thi Nguyen <ttn@giblet.glug.org> writes:

    thi> this is really cool stuff!

    thi> i modified lang/elisp/base.scm `load-emacs' like so:

    thi> (defun load-emacs (&optional new-load-path)
    thi>   (message "load-path: %s" load-path)
    thi>   (cond (new-load-path
    thi>          (message "Setting load-path to: %s" new-load-path)
    thi>          (setq load-path new-load-path)))
    thi>   (message "load-path: %s" load-path)
    thi>   (scheme (read-set! keywords 'prefix))
    thi>   (message "Calling loadup.el to clothe the bare Emacs...")
    thi>   (load "loadup.el")
    thi>   (message "Guile Emacs now fully clothed"))

    thi> and then tried to write examples/lang-elisp/load-emacs (below) w/o
    thi> success; the 20.7 loadup.el is still being searched instead of what i
    thi> specified.  didn't get a chance to look further, but here's a short log
    thi> of the output:

    thi> cd /home/ttn/tmp/.tmp/examples/lang-elisp/
    thi> ./load-emacs
    thi> load-path: ("/usr/share/emacs/20.7/lisp/" "/usr/share/emacs/20.7/lisp/emacs-lisp/")
    thi> Setting load-path to: ("/home/ttn/build/.gnu/emacs/lisp" "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp")
    thi> load-path: ("/home/ttn/build/.gnu/emacs/lisp" "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp")
    thi> (#<primitive-procedure eval> (#<primitive-macro! quote> (read-set! keywords (quote prefix))) #<directory (guile-user) 8083260>)
    thi> Calling loadup.el to clothe the bare Emacs...
    thi> Loading /usr/share/emacs/20.7/lisp/loadup.el...
    thi> Using load-path ("/home/ttn/build/.gnu/emacs/lisp" "/home/ttn/build/.gnu/emacs/lisp/emacs-lisp")
    thi> ERROR: Signalling file-error with data ("Cannot open load file" "byte-run")

Strange.  I'll have a look...  Thanks for your interest and the report!

        Neil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Elisp translator work finished (for now)
  2002-02-12 14:38   ` Neil Jerram
@ 2002-02-12 14:59     ` Neil Jerram
  2002-02-13 13:47       ` Neil Jerram
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Jerram @ 2002-02-12 14:59 UTC (permalink / raw)
  To: ttn; +Cc: guile-devel, guile-emacs

>>>>> "Neil" == Neil Jerram <neil@ossau.uklinux.net> writes:

>>>>> "thi" == Thien-Thi Nguyen <ttn@giblet.glug.org> writes:

    thi> i modified lang/elisp/base.scm `load-emacs' like so: [...]

    Neil> Strange.  I'll have a look...  Thanks for your interest and the report!

Oh dear; my representation of Elisp variables is a bit screwy.
(`setq' sets a variable called `load-path' in (lang elisp base), but
the Scheme definition of `load' picks up `load-path' from (lang elisp
internals load).)  I'll try to fix this in the next few days.

Thanks again.

        Neil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Elisp translator work finished (for now)
  2002-02-12 14:59     ` Neil Jerram
@ 2002-02-13 13:47       ` Neil Jerram
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Jerram @ 2002-02-13 13:47 UTC (permalink / raw)
  To: ttn; +Cc: guile-devel, guile-emacs

>>>>> "Neil" == Neil Jerram <neil@ossau.uklinux.net> writes:

>>>>> "thi" == Thien-Thi Nguyen <ttn@giblet.glug.org> writes:

    thi> i modified lang/elisp/base.scm `load-emacs' like so: [...]

    Neil> Strange.  I'll have a look...  Thanks for your interest and the report!

    Neil> Oh dear; my representation of Elisp variables is a bit screwy.
    Neil> (`setq' sets a variable called `load-path' in (lang elisp base), but
    Neil> the Scheme definition of `load' picks up `load-path' from (lang elisp
    Neil> internals load).)  I'll try to fix this in the next few days.

Should be fixed now (at least, in a few minutes once the cvs commit is
done).  I committed your generalized version of load-emacs, as well.

One small nit remaining, though - you'll need to make sure that the
elements of your alternative load-path end in slashes.

        Neil

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-13 21:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-08  3:53 Elisp translator work finished (for now) Neil Jerram
2002-02-11 14:38 ` Thien-Thi Nguyen
2002-02-12 14:38   ` Neil Jerram
2002-02-12 14:59     ` Neil Jerram
2002-02-13 13:47       ` Neil Jerram

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).