Re:New SSA Back End for the Go Compiler (2015)
by willtim on Saturday April 02, 2016 @02:00PM
(#11412497)
Like Appel, I wasn't entirely serious about it being a "functional language", but I think the point still stands, it is a major step towards a more mathematical program representation ("variables" instead of "assignables"). And just like "functional programming", the primary goal is ease of reasoning.
CPS is typically used to handle imperative control structures by impure functional programming languages, so it should indeed be of interest to imperative compiler authors.
Re:New SSA Back End for the Go Compiler (2015)
by willtim on Saturday April 02, 2016 @06:05PM
(#11413722)
The paper "A Correspondence between Continuation Passing Style and Static Single Assignment" by Kelsey, suggests SSA has a lot more in common with functional programming than you seem to believe it has.
I think one could read too much into the "single-assignment" part of SSA. Sure, functional languages don't tend to rebind variables either, but that's really all SSA has in common with them.
I'm familiar with Appel's "SSA is a functional language" article, but the vibe I got was more than he was trying to build some bridges between the SSA and CPS camps to try to get some cross-pollination going and knowldge sharing between them.
I think he could have just as easily called it "CPS is an imperative language", but my hunch is the FP folks are more persnickety and wouldn't have swallowed that as easily as imperative folks would accept the other title.