On 29 May 2013 00:01, David Nadlinger <see@klickverbot.at> wrote:
On Tuesday, 28 May 2013 at 13:56:03 UTC, Manu wrote:
Yep, I can imagine it would work really well, if the front-end implemented
the logic to factor out redundant inc/dec ref's.

It isn't the best idea to do this sort of optimizations (entirely) in the front-end, because you really want to be able to aggressively optimize away such redundant operations after inlining at what previously were function boundaries.

But then again, if you use AST-based inlining like DMD does, it might just work… ;)

Can you comment on the complexity of implementing this sort of garbage collection? (not really garbage collection, but serves the same purpose)