Porting std.typecons to Phobos 3

Adam Wilson flyboynw at gmail.com
Sat Nov 9 10:48:16 UTC 2024


On Saturday, 9 November 2024 at 05:44:37 UTC, ryuukk_ wrote:
> - 
> https://github.com/WalterBright/documents/blob/master/sumtype.md
>
> - 
> https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md
>
> I could go on and mention the other popular high level 
> language, C#, Java, Kotlin, they all agreed to promote them as 
> essential language feature
>

They are not built-ins in C#, it's a library type: 
`System.Option<T>`. A cursory search shows that Java is also a 
library type, specifically `java.util.Optional<T>`. Please do a 
cursory web search before making false assertions.

> The question to be asked is, there is demand for better Tuple, 
> Sumtype and Optionals, why not take the opportunity to give 
> better, ie: not requiring importing bunch of templates
>
> We want great build time and great error messages
>

This is letting perfect be the enemy of good. As it stands today, 
there are no approved DIP's for either of these types. Much less 
merged implementations. And until an implementation is merged 
into DMD, Phobos cannot count on the existence of something.

Standard libraries are necessarily highly conservative things. 
Currently, we don't even allow some things that have been 
implemented, such as DIP1000, because they are too 
complex/buggy/etc. It is reckless to take a dependency on 
something that hasn't even been specified, much less implemented. 
If these get implemented in the language prior to the release of 
Phobos 3, we can reevaluate, but even then we may chose not to 
use it if the implementation is too buggy or incomplete.




More information about the Digitalmars-d mailing list