Doing many passes seems to be working very well in LLVM, which is definitely not targeted at or implemented with functional languages and is not a toy compiler framework for educational purposes but a full-blown industrial strength compiler framework.<p>Yes, you need to take care of garbage collection (in one way or another) when you&#x27;re manipulating tree and graph structures.<p>I can&#x27;t share your opinion about &quot;ending badly&quot;. This has been shown to be a good strategy in practice.