News for hackers. Stuff that matters.
Re:Don’t Think, Just Defunctionalize by joosters on Wednesday December 23, 2020 @06:43AM (#25516622)
Is this a technique that an optimizing compiler could automatically make use of? i.e. is it practical for a compiler to look at a (limited-size) function and be able to tell if refactoring it into a tail-calling version is possible?

(I'm sure the general case becomes 'halting problem' hard, but limiting the analyzed function size / cpu time might perhaps still manage to refactor enough code to be useful?)

Re:Don’t Think, Just Defunctionalize by mratsim on Wednesday December 23, 2020 @09:26AM (#25517893)
CPS for functional language is the equivalent of SSA for imperative language, an excellent Intermediate Representation to apply optimization on.