Discussion Thread: DIP 1042--ProtoObject--Community Review Round 1

Paulo Pinto pjmlp at progtools.org
Tue Jan 11 13:45:35 UTC 2022


On Tuesday, 11 January 2022 at 12:52:42 UTC, RazvanN wrote:
> On Tuesday, 11 January 2022 at 06:25:34 UTC, Rumbu wrote:
>> On Monday, 10 January 2022 at 18:09:21 UTC, russhy wrote:
>>>
>>> Does the language not have enough to avoid OOP? let's solve 
>>> that first!
>>
>> Here we talk about "Object" which - I fail to understand the 
>> surprise - it is about OOP.
>>
>> More than that, since it is a tight dependency between objects 
>> and the garbage collector, what improvement will render a 
>> @nogc thrown here and there? Currently there is little support 
>> în the language for using objects outside gc, I really don't 
>> understand why limit the overrides to patterns that will be 
>> difficult to satisfy. In my opinion the only qualifier that 
>> must be put to these basic functions is @safe. Hashing can be 
>> a costly operation (think at files or streams), const will 
>> prevent any caching. Comparing strings for example can 
>> discover invalid unicode characters, why nothrow? Comparing 
>> timestamps may need reading the current time zone, why pure?
>
> But we are not imposing anything by switching to ProtoObject.
> ProtoObject is an empty class that gives you the ability to
> implement **whatever** you want. The utility functions that
> we are providing are optional. If they don't cut it for your
> special case you can just implement whatever interface you want.

The whole point of the standard library vocabulary types is to 
provide common abstractions that the whole ecosystem can rely on.

If every D shop has to come up with their own interfaces because 
the ones offered by the DIP don't cut, then what is the purpose 
of having them in first place?


More information about the Digitalmars-d mailing list