Hi Noah, Noah Lavine <noah.b.lav...@gmail.com> writes: > Yes, I completely agree with this. I didn't do that immediately > because I'm trying to get the infrastructure for the general case > working. I plan to implement un-boxing in CPS.
You still seem to be proceeding from the assumption that the conversion to CPS will happen early, and that all optimizations will happen in CPS. I continue to think that this is a bad idea, because of the order of evaluation issue. I realize that you intend to extend CPS with some way to express unspecified evaluation order, but I'm not sure that is a good idea. The fact that CPS fully specifies evaluation order is not merely an undesirable flaw to be remedied. It is fundamental to the nature of CPS form, and an important part of what makes CPS desireable as an IR. I fear that in trying to get the best of both worlds, you will instead end up with the worst of both worlds. I suspect that the way to get the best of both worlds is to do several optimizations *before* conversion to CPS. We already have an increasingly sophisticated set of optimization passes implemented in tree-il. Those early passes already analyze whether or not lexicals need to be mutable or not, and make several optimizations that depend on having this information. Do you intend to rewrite all of those passes for CPS? Regards, Mark