gerd.moellmann@... (Gerd Moellmann) writes:
> > Now, the difference between that approach and what I'm trying to do is
> > that the two-pass system allows us to build up the information we need
> > in the sbcl-as-application system to be able to construct the relevant
> > initialization forms for the cold core to execute.
> > To make this slightly more concrete: at the moment, on
> > pcl_build_1_branch, we build defclass.lisp and defs.lisp in the cold
> > build procedure, so that when we get our cold-sbcl.core it has in it a
> > variable *EARLY-CLASS-DEFINITIONS* which contains the early class
> > definitions you would expect to see.
> I've thought of something like that for the case of avoiding
> cold-bootstrapping PCL. Basically, teach genesis how to write out the
> state of a fully-bootstrapped PCL and initialize a cold PCL from that
> information. That should be, maybe very roughly, equivalent to what
> you are doing, I think.
> Also not exactly easy to do.
Not easy, but in the SBCL world at least half of the problems have
already been solved, because we can do this for structures.
As I've said, DEF!FOO in SBCL sources should be read (roughly) as
"make a host FOO, and as soon as possible also make a target FOO".
However, in DEF!STRUCT there's a little more hair, it turns out,
because of course it is strictly speaking impossible to make a target
structure on the host; structures on an arbitrary host could be
represented in all sorts of wacky ways. We need to dump structures,
e.g. CTYPEs and LAYOUTs, because TYPEP and structure slot access are
implemented in terms of them.
So DEF!STRUCT includes another option over and above DEFSTRUCT (and
here I start getting hazy, because we're into deep voodoo here ;-):
:MAKE-LOAD-FORM-FUN. The effect of this is effectively (Bill, please
correct me if I'm off track here) to teach SBCL-as-application how to
dump a host representation of a target structure in such a way that
genesis or LOAD will be able to reconstruct the target structure.
I think that something of this nature will be necessary for the next
two files in my operation; dlisp2.lisp wants to create at
macroexpansion time some objects that look like
so either I need a workaround, or I need to create some kind of host
structure that will be dumped (using MAKE-LOAD-FORM magic) as a
> > Do you see what I'm driving at?
> I think so. You are aiming at building a class tree only in a first
> step, which I think should work with BOOTSTRAP-META-BRAID, provided
> all classes in the tree are suitable recorded in some way.
It doesn't have to be a complete class tree -- it only has to be
enough classes to allow LOAD-DEFCLASS (the full version in
std-class.lisp) to work in a normal fashion.
> > Basically, I think with my way (or the hacky CMUCL way) it ought to
> > be possible to remove the need for *BOOT-STATE*'s existence -- in
> > the CMUCL philosophy by querying the running CLOS for the
> > information it needs; in the SBCL worldview by using the information
> > built up while building the cross-compiler...
> In a way, I can do that already with #+COLD-PCL, with the usual boot
> files that might be necessary to get from one version to another.
> I think I could cold-load fasls from a #+COLD-PCL build and have
> something in the cold core that basically doesn't need to be
Yes. I think from the state you're at it's a SMOP, as long as you
never want to make an incompatible change, at which point...
> Problem---lots of work and hair in getting the dynamic state
> reconstructed. But it could well be that this is the only way to get
> CLOS into the world.
... yes, I think it is, at least if you stick to the one-pass
compilation strategy. ;-)
> Or, maybe it's possible, say by precompiling what's needed, to make
> PCL usable enough and early enough for the compiler and world to use
> it, and at the same time prevent PCL from calling other parts that are
> not yet up and running. I don't know.
I think this is probably harder, actually, and is likely to be
extremely fragile -- it'll limit the changes you can make to the
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)