Making AssertError a singleton

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 13 14:12:57 PST 2016


On Tuesday, 13 December 2016 at 13:59:13 UTC, Andrei Alexandrescu 
wrote:
> On 12/13/2016 01:34 AM, Shachar Shemesh wrote:
>> unlinking GC from phobos is not likely to happen until that 
>> happens
>
> You can avoid linking druntime today with -betterC. -- Andrei

You can avoid linking druntime _now_. And betterC is so extreme 
in what it's trying to do that it would arguably better off with 
an entirely different build of druntime if they're willing to use 
druntime at all.

If you really want to support betterC with druntime, I would 
suggest using version blocks for the areas that the betterC folks 
can't afford and then have a betterC build of druntime without 
them. And if something needs an alternate implementation for 
that, then it can have it. In an environment like that 
AssertErrors could probably even just be malloced and thrown 
without caring about catching them, because the program is about 
to die anyway. If they still want AssertErrors with contracts and 
unit tests though, then we really need an RC solution with malloc 
and not the GC or singletons.

Regardless, I really don't want to see functionality removed from 
druntime or Phobos because of betterC. I'm fine with supporting 
betterC if it's not impacting normal D stuff, but the position of 
betterC is so extreme that it could very quickly negatively 
impact normal D if we start catering to it.

- Jonathan M Davis


More information about the Digitalmars-d mailing list