SumType in Phobos?

Petar Petar
Wed Feb 19 10:57:29 UTC 2020


On Wednesday, 19 February 2020 at 09:53:05 UTC, Ernesto 
Castellotti wrote:
> On Wednesday, 19 February 2020 at 08:23:57 UTC, Petar Kirov 
> [ZombineDev] wrote:
>> In summary, I believe that Phobos needs to grow up and break 
>> free from the compiler releases and go become a dub package. 
>> Then I see no reason why Phobos should not adopt SumType - it 
>> will be just one line of code in its dub.json/dub.sdl ;)
>
> Phobos as a dub package?  It would be extremely interesting to 
> distribute the STD without depending on the compiler.
> The problem?  Dub ;-)
>
> I think it will be extremely difficult to convince people to 
> use dub, there are technical problems with dub (but this can be 
> solved, so ok) but above all people want all working out of the 
> box.
> Having to use dub to compile every file that uses the STD I 
> don't think it's a good idea.
>
> Tell me if there are any details that could improve the 
> situation

Let me rephrase my suggestion, as perhaps I put way too much 
emphasis on Dub as the solution. I think that the basic minimum 
is having:
A) ability to download and use different library versions 
(including Phobos), independent of the compiler release
B) semantic versioning, so that any library can receive bug fixes 
from its dependencies while shielding users from breaking changes.

The rest is details. Yes, I think that right now the best 
solution to that problem is Dub as a package manager, but I also 
don't think that people should be forced to use it if they really 
don't want to. For example, we could continue bundling each 
compiler release with Phobos, while having it also available 
separately with SemVer-correct versioning model.


More information about the Digitalmars-d mailing list