freenode/#sicl - IRC Chatlog
Search
12:57:32
beach
I just had an epiphany!!!! Strange as it may seem, I have been thinking of an aspect of one of my own inventions (first-class global environments) the wrong way. I have been confusing two different concepts, namely 1. Loading compiled code (i.e. an AST) into some environment E1, and 2. "tying" the code to an environment E2.
12:57:49
beach
Up until now, I have been thinking that 1 implies 2, so that E1 = E2. Recall that a direct reference to a function (by name, say F) in compiled code gets turned into the de-referencing of some "cell".
12:57:57
beach
Also recall that this cell is found in E2 when the compiled code is loaded into E1 and then the cell is put into the static environment of the functions in the compiled code that refer to F. As I said, up until now, I always supplied the cell from E1 when the compiled code was loaded into E1.
12:58:05
beach
But that does not have to be the case. In fact, the essence of the epiphany is that the only role of E1 is to supply definitions of function to be executed at load time. My mistake was to refer directly to protocol functions for first-class global environments (or Clostrum) with a specific environment (E1) when the code is loaded.
12:58:14
beach
Instead, I should refer to functions such as (SETF CL:FDEFINITION), and FUNCTION-CELL (not the first-class global environments protocol function, but a function yet to be defined), etc. That way, these load-time functions can set the FDEFINITION in E2 and return the function cell in E2.
12:58:24
beach
Why is this important, you might ask? Well, as it turns out, it holds the key to a problem that I have not had a clue how to solve, namely how to create the initial native first-class global environments for the SICL executable. All the environments during bootstrapping are host objects, and I have been unable to figure out how to create the initial target environment as a SICL object.
12:58:25
beach
Now I know!!! One environment represented as a host object, into which code will be loaded, will contain functions to tie the code to a target environment, represented as a SICL object.
13:02:15
beach
This epiphany may also change how SICL code is executed in the host. Perhaps it could make HIR evaluation unnecessary (sorry if so, heisig). But I am not sure about that yet. More thinking is required.
13:07:35
beach
The hunch goes like this: In the last step of bootstrapping, Compiled code is loaded into some first-class global environments En, represented as a host object. The result of this action is native SICL code in some first-class global environments Esicl, but the code in that environment will never need to be executed in the host.
13:08:17
beach
I don't know what that means, and I haven't made up my mind about the terminology for the different environments.
13:09:46
beach
I used "loading" for E1 above, but that word is loaded [sic], so I need a different one.
13:54:46
beach
So then the question is: What is the minimum contents of an environment so that a complete Common Lisp system can be obtained by the loading of more stuff from compiled files, given that the loading process itself can be obtained by the execution of host code?
13:55:22
beach
I am thinking, the MOP class hierarchy and the accessor generic functions with their methods specialized to those classes.