Integrated code formatter

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 18 03:39:10 UTC 2022


On Tue, Jan 18, 2022 at 01:46:58AM +0000, forkit via Digitalmars-d wrote:
[...]
> Surely I am not the only one that declares a dynamic array initialised
> using a Result set?
> 
> Is this not allocated on the GC managed heap?

Of course it is.


> How has that been excluded from the original implementation
> considerations of -profile=gc

For historical reasons, I wager.  The earliest versions of D did not
have templates nor ranges.  Neither was there @nogc.  And IIRC, there
wasn't core.memory.GC either, or maybe it was there but not with the
entire API that we have today, I'm not sure.  At any rate, at the point
where -profile=gc was implemented I believe built-in constructs *were*
the only constructs to GC-allocate.  So it worked well at that time.

Since then, many things have changed, and it looks like -profile=gc has
bitrotted to its present sorry state.


> And more to the point, excluded from considering adding it to this
> feature, for 7 years now.
> 
> I don't get it.
[...]

The problem with programming language design is that the design space is
exponential in the number of features. Every new feature added, every
language changed introduced, produces a ripple effect that percolates
throughout the language in exponentially-many combinations that are
impossible to exhaustively test.  So it's pretty much inevitable that
some combinations of features will be poorly-tested or not tested at
all.

On top of that, most bugs occur around boundary cases, and generally
people who have been using older versions of the language are less
likely to encounter these boundary cases, because they have become
habituated to older, well-worn idioms. So they're less likely to notice
these corner cases. Newcomers tend to find them more easily, though,
because they haven't acquired the old habits. (Which is another reason
it's important to file bugs: old-timers are less likely to encounter
these bugs again and fix them.)

That, and old-timers tend to know their way around better, and upon
encountering problems would resort to workarounds, avoiding the problem
feature, so the problems can linger.


None of this excuses the present sorry state of things, of course. My
inclination is to pull the trigger on -profile and -profile=gc. Or at
the very very least, put a big fat warning in flashing bold red letters
in the docs of the latter so that newcomers don't fall for it.


T

-- 
Bomb technician: If I'm running, try to keep up.


More information about the Digitalmars-d mailing list