unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* guile and emacs: unexec
@ 2009-06-12  5:02 Ken Raeburn
  2009-06-13 13:06 ` Andy Wingo
  2009-06-18 20:44 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Ken Raeburn @ 2009-06-12  5:02 UTC (permalink / raw)
  To: guile-devel

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.




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

end of thread, other threads:[~2009-06-20 23:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-12  5:02 guile and emacs: unexec Ken Raeburn
2009-06-13 13:06 ` Andy Wingo
2009-06-14  5:21   ` Ken Raeburn
2009-06-20  9:33     ` Andy Wingo
2009-06-20 23:58       ` Ken Raeburn
2009-06-18 20:44 ` Ludovic Courtès

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