Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

CPS has book keeping related to nested structures whereas SSA has the dominator tree.

CPS is usually higher order and SSA usually first order. As in the continuation you're passing in CPS is probably a closure with some state attached. In SSA you'd have expanded that to pass a function and some explicit state argument, making the allocation explicit.

I think the big thing in favour of CPS was it came first but I could be wrong about that. The lambda people came up with CPS and the imperative people came up with SSA. A while later Appel pointed out that they're views on very similar things. https://www.cs.princeton.edu/~appel/papers/ssafun.pdf is worth reading if you haven't seen it yet.



> CPS has book keeping related to nested structures whereas SSA has the dominator tree.

CPS compilers have to do a lot of work to get rid of pessimization due to unnecessary closures. Inlining, contification, and lambda lifting are some of the things they have to do. IIUC SSA compilers don't have to do that, which is their main advantage (i.e., they are naturally faster).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: