On Wednesday, 9 January 2013 at 07:42:39 UTC, Mehrdad wrote:
Also might mention, we implemented a compiler for a subdialect
of Python (including full closures) for our compilers course,
which the compiler subsequently translated to C++.
GC wasn't required (we were allowed to never deallocate), but
since I didn't feel like doing that I added reference counting
using a lot of shared_ptr's and intrusive_ptr's.
I also added a GC just for the sake of catching cyclic
references, but it was just that -- everything was reference
counted, so if you never had cyclic references, the GC _never_
kicked in, period.
This is a very valid way to manage things in D as well, remember
that you have GC.free available.