Why Phobos is cool

Paolo Invernizzi paolo.invernizzi at gmail.com
Thu Jun 25 15:33:18 UTC 2020


On Thursday, 25 June 2020 at 14:27:02 UTC, Petar Kirov 
[ZombineDev] wrote:
> On Thursday, 25 June 2020 at 12:13:21 UTC, Paolo Invernizzi 
> wrote:
>>
>> I know that we are quite few on this side, but IMHO a well 
>> shaped standard library has advantages over a sparse ecosystem 
>> of independent library ...
>
> Who says that this is a binary choice? And also, the way you 
> fraise it it's obvious that say Flutter is better choice than 
> React as everything is very tightly integrated and you could 
> build your whole app without reaching for third-party code. 
> Also, it's obvious that in terms of trust, it's better to rely 
> on the diligence of the upsteam development team, than random 
> strangers from the internet.
>
> But what if 90% of the code my team needs has no place in 
> Phobos? We already have to rely heavily on third-party 
> packages. Yes there are a lot of risks and we try to be 
> careful, but we have no other choice. We could spend years 
> reiventing the wheel (high-quality code that already exists in 
> other languages), or we could focus on delivering products to 
> our users based on the already existing ecosystem in other 
> languages. Well, a choice would exist if we had an unlimited 
> budget, but given that we're not as lucky, we can only use 
> other languages for our projects currently.
>
> Technically, phobos is actually already on Dub 
> (https://code.dlang.org/packages/phobos), so in the future 
> nothing could prevent you to continue using it, but you would 
> just get it from there and not from the compiler distribution 
> archive. It's the same code, made by the same people, just with 
> a different distribution model.
>
> The way I see things is that we as a community need to focus on 
> a vetted, well shaped collection of libraries.
> We need to have process where third-party libraries are able to 
> gain broader support and join dlang-community. Also we need 
> dlang-community to have a healthy number of people who actually 
> maintain the code.
> We need the leadership to realize that investing just in dmd, 
> druntime and phobos is necessary, but very insufficient.
> W&A need to stop pretending that Dub doesn't exist. I feel that 
> unless we embrace using code.dlang.org as method of 
> distribution of everything that's currently part of the 
> compiler archive, Dub's limitations will never be addressed and 
> from that the broader community will suffer.

I understand your point of view and what you are trying to say. 
In my opinion it's a chicken and egg problem, IMHO.

My question is: why 90% of the code you need is not in Phobos, 
and why is Phobos stagnating? In the just released beta of DMD, 
there are zero Phobos references in the changelog ...

>> Anyway, if we can, we try to stick with Phobos, as long as we 
>> don't have a particular problem to solve that needs an 
>> external library: recent example, Martin std.io or SumType 
>> instead of std.variant ...
>
> See, some of the problems in Phobos already have a good 
> solution. The problem that we need to address is the trust.
> The more high-quality and well-maintained libraries there are, 
> the less cautious one would need to be before reaching to 
> code.dlang.org.

It's not only a problem of trust, it's a problem of integration 
and maintenance also: for example, some days ago I tried to use 
Martin and Steven std.io with std.concurrency, and I faced a wall 
of problems related to non copiable struct, variants, reference 
counting implementation, and so on ...

I know that there're advantages in flexibility, but there are 
costs also, for example, not everyone scouting for DLang as a 
candidate for a task has your (great!) experience in managing all 
the sort of problems that arises when trying to combine different 
packages, or has the experience (or the time?) to choose the 
"golden" one.

Anyway, you are right, it's not a binary choice.

/P





More information about the Digitalmars-d mailing list