I think the important thing is to consider just how costly
the other options are. I'm no expert when it comes to GC, but there
are a myriad of options available and I think that timely
destruction has one particular benefit: consistancy.
The timely deterministic options (which, in a language with references, is
singular--refcounting) are expensive, both in processor time and in
programming time. Also rather error-prone, unfortunately.
They also don't guarantee consistency, though they do guarantee
determinism. Not that you're necessarily going to guess the time
right, but you've a reasonably good chance.
To take one particular operation and declare "This could
happen at any old time" instantly puts the programmer into headache
mode"
That's always true, though. Perl is sufficiently introspective, and
is getting more introspective, to make timing of destruction potentially
indeterminate. And most objects don't have DESTROY methods. Just wait until we start throw
I see little choice but to make timely GC an option, but I am
confident that there is enough collective brainpower available to make
it efficient as an option under reasonable
circumstances.
Thanks for the vote of confidence, bu I should point out that I am the brainpower in this case,
along with a stack of books and papers by people rather more clever
than I am. If it was easy or inexpensive to do this, I wouldn't be
asking the question.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|