SumType in Phobos?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Feb 19 17:37:25 UTC 2020


On Wed, Feb 19, 2020 at 04:45:06PM +0000, Petar via Digitalmars-d wrote:
> On Wednesday, 19 February 2020 at 16:31:25 UTC, Rumbu 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.
> > 
> > This is a bad idea. I survived until today without dub and I intend
> > to avoid it in the future.

I have also avoided dub except for one vibe.d project where it's
unavoidable. It tries too hard to be both a package manager and a build
system, but falls short of the former (compare, e.g., Cargo) and IMO
sux at the latter.


> As I mentioned in other posts, Phobos can and will be distributed as
> part of compiler releases even if it becomes a dub package. The most
> important thing is to separate the releases so that projects have the
> option to upgrade std at their own pace and not be forced to endure
> breaking changes in Phobos, whenever they need to upgrade their
> compiler.

This is easier said than done, though.  In the past there have been
numerous changes that required changes in both the compiler and Phobos
to be synced with each other.  Ditto with druntime (and sometimes all
3).  Granted, such changes are infrequent, but when they do happen,
there needs to be a way to coordinate them in a way that doesn't wind up
horribly breaking user toolchain environments.

Having Phobos as a separate package will make this very tricky when you
cannot be certain that the user is using a compatible version of Phobos
with a compatible version of the compiler.  Remember how in the old days
people used to have stray copies of phobos/druntime lying around their
filesystem, and it would lead to obscure ICEs and other inscrutable
problems that "magically" go away when they purge all copies of
phobos/druntime and reinstall?  That's the kind of breakage we'd have to
deal with if we went this route, except this time it will be worse
because now users will say, "but I'm using the official dub version of
Phobos, why is that not supported?".


T

-- 
A programming language should be a toolbox for the programmer to draw upon, not a minefield of dangerous explosives that you have to very carefully avoid touching in the wrong way.


More information about the Digitalmars-d mailing list