Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!indri!xanth!mcnc!rti!talos!kjones From: kjones@talos.UUCP (Kyle Jones) Newsgroups: comp.emacs Subject: Re: Does GNU emacs ever use shared libraries? Message-ID: <537@talos.UUCP> Date: 23 May 89 20:21:42 GMT References: <152@talarian.UUCP> <6006@xyzzy.UUCP> <40094@bbn.COM> Reply-To: kjones%talos.uucp@uunet.uu.net Distribution: usa Organization: Philip Morris Research Center, Richmond, VA Lines: 34 In article <40094@bbn.COM> jr@bbn.com (John Robinson) writes: > It struck me that the way to build emacs is to make the compiled, > loaded elisp into a shared library. Can anyone comment on the > feasibliity of this? It seems to address the need that emacs' loadup > phase addresses, and by definition is the "right" way to do things in > SunOS 4 and other shared-library universes. Since this stuff is by > definition non-portable, is a shared-library approach better than an > unexec approach in jamming one less unportable feature into one > executable? Shared libraries strike me as being the cleaner way, in that once shared libraries become more common, the various versions of unexe.c can be replaced by something more easily understood. If UNIX systems are in fact converging the result may be a bit more portable. As for me, the approach I favor is to rework unexec.c to dump a series of C files. These files would contain definitions for the initialization of the appropriate Lisp data structures. The files would be compiled and Emacs would be linked with these objects to produce a dumped executable. This approach has already been successfully used in at least one Lisp system, and I'm told that a C version of TeX unexecs in this way. This approach has the advantage of being completely portable, if implemented properly. It can be done, but it will require a massive reorganization of Emacs' C source to isolate all global variables and tables that are dumped. Also Emacs' memory allocation procedures will need to be decoupled from malloc()'s internals, and probably some work will be required to alert the garbage collector to thses shenanigans. Not a project for the timid. It would have been much easier when Emacs' was younger and smaller and wasn't walking the tightrope between so many systems. So massive a rewrite now would probably stir a plethora of old bugs back into life. kyle jones ...!uunet!talos!kjones "It's bigger because it ate Rachel!" Laverne cried, and began to scream again.