libera/#sicl - IRC Chatlog
Search
10:33:49
beach
With the planned AST transformations, the only operator that creates functions will be LABELS. So I can do an escape analysis by checking which function names appear in an argument position of a function call.
10:34:14
beach
And I can make a call graph where the nodes are functions and the arcs are calls. Any function that does not escape and that is not in a cycle of that graph can have its environment shared with its parent function. To indicate that fact, I can re-introduce LETs which will now always introduce temporary variables that will not be closed over.
10:34:21
beach
Another transformation I can do at the AST level and that is currently done at the HIR level is making argument parsing more explicit. For that, every &OPTIONAL and &KEY parameter is replaced by two lexical variables, one for the parameter itself and one for a "supplied-p" parameter, but no initforms.
10:34:23
beach
Code in the body of the function checks the supplied-p parameter to determine whether to evaluate the initform of the original lambda list. Code in the body also binds the original lambda-list parameters according to whether they are lexical or special variables.
10:36:43
beach
After escape analysis and environment merge has taken place, I can introduce LETs for nested function calls, so that each function calls has only variables as arguments.
10:38:39
beach
I haven't given much thought yet to things I can do with lexical non-local control transfers from TAGBODY/GO and BLOCK/RETURN-FROM, but I will.
10:40:43
beach
I don't get much feedback related to these ideas, so I don't know whether my descriptions are understandable, whether they represent good ideas, etc. So I guess the only way to figure out whether they are good ideas or not is to try them out.
10:41:49
beach
And I am improving the AST visualizer, because I think it is actually doable to visualize ASTs of fairly complex functions and get an idea about what they do, as opposed to HIR graphs that very quickly become too large to understand.