freenode/#sicl - IRC Chatlog
Search
4:08:35
Harag
beach: you will be relieved to hear that I have no more issues with the translations of forms, have not tested every form imaginable but what I tested works
7:06:50
heisig
OK, both the HIR interpreter and the HIR evaluator take exactly the same branches up to the point of the error.
7:24:55
heisig
It is of course related to the manipulations of the dynamic environment, but not in the way I thought.
7:25:29
heisig
The way I compute and memoize instruction thunks is not suitable for augmenting a thunk with :around, :before or :after methods.
7:26:02
heisig
So I ended up caching a thunk that was not wrapped in the proper augmentations for the dynamic environment.
7:32:43
beach
When it works, it will be interesting to see the difference in performance compared to the interpreter. Currently, the boot procedure takes more than 5 minutes on my machine.
7:34:39
heisig
I still use the hash table, but only while generating instruction thunks. The table maps each lexical variable to a CONS cell that hold the actual value.
7:35:58
beach
I can confirm that manipulating the lexical environment represents a significant performance cost in the interpreter.
7:37:09
heisig
Katharina and I will do a quick bike tour now, before it is getting too hot outside. I hope I can fix the issue afterwards.
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...