Comment

Comment by fourteenminutes

Yes - if the closure representation is recursive, it must be boxed. I believe your example is also that given by the original author (William Brandon et.al.). I don’t think there is any way around this, because it is the same as any other recursive data type at that point.

Although, if you know at compile time the size of the list, you could imagine compiling the recursive data type “unrolled” into a statically-sized array - but now you need dependent types.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton