Phobos 2

qznc via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 2 02:14:14 PDT 2017


On Thursday, 1 June 2017 at 18:40:05 UTC, Brad Anderson wrote:
> A (surely controversial) idea popped into my head while talking 
> in #d on Freenode. The C++ guys are making an STL2 (the 
> highlight of it being that it is range based). What about 
> taking all the lessons learned from Phobos and creating a 
> Phobos 2? It wouldn't replace the current version. You could 
> import either in one program. It also wouldn't be a radical 
> redesign. Most of Phobos could be used as is. What it would do 
> is allow fixing some hard or impossible problems without losing 
> backward compatibility.
>
> We could do away with auto-decoding. Design it around using 
> Andrei's allocators throughout. Make the GC optional from the 
> start. Fix a few important naming conflicts and discrepancies.
>
> There are problems, of course. Rampant code duplication is 
> probably the biggest (though maybe public imports of identical 
> code would help a lot).
>
> I don't really expect this to go anywhere but I am curious to 
> hear what changes you'd all like to see made to Phobos that 
> can't happen because of backward compatibility. Also, how would 
> you approach doing this? An on disk copy of Phobos with changes 
> would not be an acceptable approach, I think.

Frankly, I do not see the need for Phobos2. If you want to build 
alternative packages, just go ahead and publish them via dub like 
Mir, for example. You can even make a meta package, if you find 
yourself using the same group of packages all the time. Still, 
why would you call that meta package "Phobos2"? It only confuses 
people.

If you want to rewrite parts of the standard library, build the 
alternatives first and then we can adopt them piecewise.

Nevertheless, I would love to read a detailed analysis of Phobos 
and what should be improved. Please, write a blog post somewhere. 
However, do not mention "Phobos2".

D has a painful history with two competing standard libraries. If 
you seriously propose this path, I hope Andrei and Walter will 
publicly and vehemently oppose it. Otherwise that ghost from the 
past becomes a PR disaster for D.


More information about the Digitalmars-d mailing list