guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile and emacs: unexec


From: Ken Raeburn
Subject: guile and emacs: unexec
Date: Fri, 12 Jun 2009 01:02:53 -0400

I'm glad to see the emacs-lisp work is progressing. As it happens, a month or so ago I blew some of the dust off my old guile-emacs project and started working on it again too. This flavor of emacs+guile work aimed to replace Lisp objects in Emacs with Guile objects at the lowest level (numbers, cons cells; symbols and such become smobs) and then work upwards from there.

I've updated to recent Emacs sources and Guile 1.8.6. I've gotten it to a point where it seems to start up fine in tty mode, reads in (and does color highlighting of) C files and directories, does some other basic stuff. I'm tweaking it now to see if I can get more stuff working (like Cocoa support and "make bootstrap") and do more extensive testing.

One really big hiccup I've run into, which I've sort of sidestepped for the moment: Guile is not unexec-friendly.

There is a way to build Emacs so it doesn't use unexec, but it then has to load a lot of Lisp code at run time, really killing the startup performance, and I don't think it's tested all that much (e.g., "make bootstrap" doesn't work even without the Guile hacks). To really make this project work, I need to be able to link against Guile (static is fine, and probably necessary), do a bunch of Lisp/Scheme processing, write out a memory image into a new executable, and later be able to run that executable.

Any record of current threads needs to go away, and be replaced with info on the new one-and-only thread in the new process; I'm building without thread support for now to get around it. Any record of stack regions to be scanned for SCM objects likewise needs resetting. Allocated objects must *not* go away, and must continue to be processed by the garbage collector, so I can't just reinitialize everything. Assigned smob types must remain in effect, and for now I'm ignoring the possibility that some smobs may need some kind of reinitialization. Mutexes... well, I don't know if they need reinitializing; POSIX is kind of unclear on interactions with unexec. :-) I expect reinitializing them is probably safe, even if not required in some implementations.

So... I could use some advice here. Is anyone familiar enough with these bits of the guts of Guile to be able to point out easily what I should do to reset the relevant parts of Guile's internal state without trashing other stuff by mistake? Is this something that could be useful to anyone outside of Emacs?

Ken

P.S. If anyone wants to take a look at my current work, http://www.mit.edu/~raeburn/guilemacs/guile-emacs.tar.bz2 has a snapshot from tonight.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]