←back to thread

170 points signa11 | 1 comments | | HN request time: 0s | source
Show context
fire_lake ◴[] No.41085430[source]
I thought that ANF is considered a dead-end?

Now the main choices seem to be CPS (which is seeing a bit of a resurgence!) and SSA.

So why teach ANF?

replies(3): >>41085488 #>>41085543 #>>41087918 #
mrkeen ◴[] No.41087918[source]
I attempted both when trying to implement a language, and I couldn't wrap my head around the typing of the term that CPS introduces, so I ended up going down the ANF road.
replies(1): >>41088346 #
fire_lake ◴[] No.41088346[source]
Appel has a book on compiling with CPS Compiling with Continuations. It’s implemented in SML so the types are front and center. Might be of use!
replies(1): >>41088572 #
1. mrkeen ◴[] No.41088572[source]
p225:

> However, having a typed CPS language would require the manipulation and reduction of types whenever B-reductions (and other transformations) are performed. Although this is certainly possible to do, it is painful enough that we have decided to avoided this approach.