Any estimates on having exceptions in betterC?

Mike Franklin slavo5150 at yahoo.com
Fri May 3 22:52:10 UTC 2019


On Friday, 3 May 2019 at 16:59:29 UTC, H. S. Teoh wrote:

>> The first step towards that, IMO, is to create a utility 
>> library that has no dependencies whatsoever.  All other 
>> libraries, language implementations, and even the compiler 
>> itself could then begin their implementations by importing 
>> that fundamental utility library.  Of course, you wouldn't 
>> have to import it if you didn't want to, but it would be 
>> highly productive and idiomatic-D to do so.
> [...]
>
> I've given a lot of thought to reusable components lately. More 
> and more, I'm coming to the conclusion that proper API design 
> is absolutely essential.  If designed wrongly, an API will 
> essentially *force* dependencies upon all of its users, and 
> this effect compounds across multiple nested APIs, the end 
> result being an inseparable hairball of dependency hell that 
> you have to either import all of it, or not at all.

I'm not proposing a new API, but I'm not against it either.  What 
I'm proposing is to just copy over the existing APIs in Phobos 
that don't require druntime for their implementation.  It would 
probably be a good idea to exclude any API from Phobos that is 
considered a mistake. And, of course, some Phobos implementations 
do require druntime and dynamic memory allocation, so those would 
also be excluded, but everything else (that makes sense) could be 
copied over to the library I'm proposing.  Those familiar with 
Phobos would feel right at home using this library.

Mike




More information about the Digitalmars-d mailing list