<div dir="ltr">On 10 October 2013 03:13, Michel Fortin <span dir="ltr"><<a href="mailto:michel.fortin@michelf.ca" target="_blank">michel.fortin@michelf.ca</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 2013-10-09 16:51:03 +0000, Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>> said:<br>

<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
On 10 October 2013 01:40, Johannes Pfau <<a href="mailto:nospam@example.com" target="_blank">nospam@example.com</a>> wrote:<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
But if someone really wants to strip the GC _completely_ there's a huge<br>
issue with memory management of Exceptions.<br>
</blockquote>
<br></div><div class="im">
Exceptions have a pretty well defined lifetime... can't they be manually<br>
cleaned up by the exception handler after the catching scope exits?<br>
</div></blockquote>
<br>
Exceptions don't need a well-defined lifetime for things to work.<br>
<br>
D exceptions are classes and are heap-allocated. So if everything becomes reference-counted, exceptions would be reference-counted too. The exception handler would be the one decrementing the reference count once it has done with the exception (all this under the hood, managed by the compiler).<br>

<br>
Alternatively an exception handler could return the exception to the parent function (as a return value), store the exception elsewhere, or throw it again, in which case the decrement operation would be balanced by an increment, and both increment and decrement should be elided by the compiler as they're cancelling each other.<br>

<br>
I fail to see an issue.</blockquote><div><br></div><div>I was talking about using exceptions without any sort of GC at all.</div><div>I think it's the only critical language feature left that relies on a GC in some form.</div>
<div>If would be nice if at least the fundamental language concepts were usable without a GC of any sort.</div><div>Most other things can be reasonably worked around at this point.</div></div></div></div>