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

> It had an immutable IR and literally every one of the dozens of passes made basically an entire copy of it.

Yeah, this is what CPS is really all about. It's not like SSA at all.

Also, it's just a dumb way to write a compiler, and so nobody does that to themselves anymore, now that SSA is widely known.

The goofy "hot" takes about how CPS and SSA are the same are usually written by CPS apologists who want to make the rest of us believe that their work on CPS is somehow relevant when it really isn't



As I pointed out in another comment, the equivalence is really just about the fact that SSA, CPS, and ANF all name each intermediate value once and avoid mutation. The rest is implementation details.

That's certainly true of "every one of the dozens of passes made basically an entire copy of it" - that's just a choice of how to implement it, which is an obvious choice if one is coming at it from a functional angle.

These kinds of approaches aren't always as inefficient as one might naively imagine, because there are usually tradeoffs involved - look at Haskell for example, which is capable of producing very performant code despite being largely purely functional. Often, the performance is gained because of the purely functional source code allowing for optimizations during compilation, like stream fusion and so on.




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

Search: