freenode/#sicl - IRC Chatlog
Search
15:30:15
beach
Bike: [changing the subject] I may have asked this before, but do you think it would be possible to do all the transformations prior to closure conversion (that we now do on HIR) on the AST, without losing any opportunities for optimizations later?
15:31:01
beach
In other words, am I right in thinking that the transformations we do after closure conversion are specific to each function?
15:33:42
beach
Do constant hoisting, fdefinition hoisting, and inlining on the AST. Then closure conversion.
15:35:02
beach
I now have top-level functions. I then want to turn each such top-level function (in the form of an AST) back to host code, much the way I did for Harag's sandbox.
15:35:41
beach
If I could do that without losing any opportunities for optimization on HIR later on, I would have a much faster way of executing SICL code in the host.
15:40:40
Bike
we spent a lot of time on moving inlining from ast level to hir level. you'd probably lose the partial inlining concept and stuff.
15:40:45
beach
Because nested functions that don't escape do not need to be independent in the resulting host code.
15:41:28
beach
But if I restrict this idea to functions that escape, then that should be no problem.
15:43:32
beach
The basic idea is that I want to turn the AST into host code for faster execution during bootstrapping.
15:44:05
beach
But that doesn't work if there is a (setf (fdefinition 'foo) (lambda ...)) in the code.
15:44:18
beach
Because then my first-class global environments will end up having host closures in them.
15:45:02
beach
And there are plenty of those. I turn a file into a single AST that does exactly that for each top-level definition in the file.
15:46:26
beach
So then I thought, if I did closure conversion on the AST, that would solve the problem, because I could then turn each such (lambda ...) into HIR, etc.
15:47:25
beach
Only functions that escape, and in particular that case (setf (fdefinition 'foo...) (lambda ...)) need be turned into HIR/MIR/etc.