freenode/#sicl - IRC Chatlog
Search
8:56:16
beach
To implement CHAR-CODE and CODE-CHAR, if I want to avoid writing them in "assembler", I see no other way than to define primops/ASTs/instructions for them. Does anyone see any other way?
8:57:34
beach
And it that turns out to be the best way, should those primops/ASTs/instructions be provided by Cleavir, or should they be private to SICL?
8:58:29
beach
I am thinking Cleavir, because Cleavir does not impose the use of any of its primops/ASTs/instructions, so I think of it as providing a service to client code who could make use of those entities.
9:01:48
beach
So CHAR-CODE in SICL is merely shifting the character 4 positions to the right to get a fixnum.
9:03:12
beach
The type inferencer could make good use of the HIR instructions for CHAR-CODE and CODE-CHAR.
9:53:31
beach
And this issue raises the question about how to organize modules consisting of a primop, an AST class, and a HIR instruction class.
9:54:16
beach
I guess there would be an ASDF system definition. Then there would be a file for the primop, one for the AST class and one for the HIR instruction class.
10:01:24
beach
And that, in turn, raises the question about whether to include HIR and AST-to-HIR in Cleavir, the day we extract it from SICL.
13:58:23
heisig
For some reason, the catch tags introduced by my translation of catch instructions don't correspond properly to catch tags in the dynamic environment.
14:20:58
beach
But I know how painful it can be to debug such things, given the sorry state of our tools.
14:23:34
heisig
The problem is that I haven't fully grasped how the interpreter represents the dynamic environment.
14:24:07
heisig
Some things are modeled via sicl-run-time:*dynamic-environment*, but most entries are just pushed to the second output of a catch instruction.
14:26:25
beach
I believe *dynamic-environment* is used around function calls, so that it can be accessed by the host closure and passed to the HIR program.
14:35:15
heisig
I have something else that I'd like you to check. In AST-to-HIR, in the COMPILE-AST method for compiling a tagbody AST.
14:36:13
heisig
If I understand the code correctly then the successor indices for each catch instructions have the opposite order than they should.
14:36:36
heisig
Because indices are incremented starting from zero, but the successors are pushed to the front.
14:38:17
beach
I suspect the order doesn't matter. The GO instruction will turn into an UNWIND with the correct index. But let me check...
16:08:37
beach
Today, I defined a few more of the undefined functions. I am down to 30 now. Frequently, when I define a function, I also add a reference to another unknown function. But the net result is an improvement, so I am not complaining.
16:09:30
beach
Two of the "undefined functions" aren't really. They are due to the compiler assuming it is a function call, when it is really a missing macro definition. I just have to load some macro definition earlier.
16:10:22
beach
Yesterday, I wrote a macro that will allow me to load code for a generic function even though there is already an ordinary function, or a host generic function, with that name in the environment.
16:13:03
beach
I haven't tested that macro yet, but it is the key to loading heisig's implementation of the sequence functions. Loading those functions may not be trivial for other reasons, but it is currently impossible without such a macro.
18:18:05
beach
So, ENSURE-GENERIC-FUNCTION returns the existing host function and can't add methods to it.