libera/#sicl - IRC Chatlog
Search
3:16:21
Bike
i've mostly finished the unwinding stuff i was doing in clasp finally. it works more like sicl's now: when you enter a block or bind a special or etc it allocates a dynamic environment object, and the unwinder consults the stack of dynamic environments to figure out what to do. works great. and i didn't need to change the IR, so that part is
3:16:51
Bike
i also found that heap-allocating the dynamic environment for a block/tagbody is not noticeably expensive and lets out-of-extent unwinds be detected gracefully. might be easier than the timestamp stuff
3:22:34
Bike
i am thinking i will introduce some default ASTs/IR/etc to represent unwind-protect and some other things that cleavir has always punted on. it will still be possible for a client to put in their own overrides of course. but without some support from the rest of the structure it's kind of tricky to maintain the unwind-protect cleanup as a function
3:29:35
Bike
karlosz's local call stuff has been extremely helpful and i'd basically like to apply it as much as possible. though i'd also like to figure out something for slightly more general situations where a given call site has a known fixed set of functions that can be called. trying to think about that in relation to abstract interpretation.
3:31:49
moon-child
wasn't it previously proposed that, when assumptions are made about a callee, the latter might be 'frozen', st redefinition doesn't apply to the call site (looking to the user as though the callee were inlined)?
3:34:31
Bike
beach: a simple example would be `(funcall (if ... #'+ #'-) ...)`. I think it should be possible for example for type inference to work out that the result is a float of all the arguments are. not sure how practically relevant it is given how people actually write CL, but i like to be general when i can
12:52:44
beach
As I said the other day, I can now load the SICL-ENVIRONMENT and the SICL-CLIENT systems into E5, which makes it possible to create a run-time global environment represented as an ersatz object.
12:52:48
beach
And I can use the loaded environment functions to st and retrieve objects in that environment, like functions, macro functions, etc.
12:52:55
beach
So now, the plan is to start loading things into one or more such ersatz global environments, which will then be the environments actually saved to the executable file. Now, there are two ways that I can think of to load things into an ersatz environment.
12:53:02
beach
The first way would mirror what I have done so far to load things into E0-E5. For that, I have host functions such as LOAD-SOURCE-FILE and higher level functions such as ENSURE-ASDF-SYSTEM. So the first way would be to create such functions in E5, and use those to load things into the ersatz environments.
12:53:13
beach
The second way would be to continue working at the host level. For that, I would need to create methods on the host version of the environment functions, specialized to ersatz classes, and it would be enough to specialize to the host class HEADER and then trampoline to the target version of the same function in E5.
12:53:22
beach
The current plan is to do it the second way. But it is not that simple, because compilation is still done by the host. This fact influences how the compiler will find macro functions and other compiler-time stuff that some system might need.
12:53:34
beach
Option 1 is to be selective with the trampoline functions, so that macro functions are looked up in some host-represented environment like E5.
12:53:40
beach
Option 2 is to pre-load the ersatz environments with macro functions by simply refer to existing ones also from the ersatz environment.
13:13:51
beach
Pre-loading the ersatz environment seems easier. But then I have to worry about eventually replacing such pre-loaded stuff by freshly loaded equivalents. Otherwise, there might be some function in the ersatz environment that has a reference to a function cell in E5. I guess that situation could be tested for.
13:20:04
beach
And there are a few more things that need to be taken care of. Defining a generic function invokes ENSURE-GENERIC-FUNCTION, and I am not sure I can pre-load it into the ersatz environment. The issue here is that if I want to eventually replace it with a freshly loaded version, then I will clobber the pre-loaded one.
13:44:24
beach
I have, of course, solved similar problems already, because they are the same between two host-represented environments like E4 and E5. But since my memory is not great, I don't remember the details of what had to be done. Not a big deal, but It means it will take a bit more time.