Proof of concept for v2 - NO duplication, NO `static if` hell, NO difficulty with interoperability

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Mon Nov 1 13:38:07 UTC 2021


On 2021-11-01 7:28, Johan wrote:
>>> I'm sorry to derail the topic of this thread, but rather than a 
>>> discussion of how to implement the versioning, I would like to see a 
>>> discussion first about what the user will see and how he is supposed 
>>> to use it. I think the implementation of it is the easy part.
>>
>> I very strongly disagree.
> 
> Perhaps you misunderstood my point, but reading your mail I see we agree 
> on most :) As you wrote a few sentences up, at least you agree that 
> implementation is indeed easy ;-)

Thanks for clarifying.

> Just having clear examples of some code would really help paint the 
> picture that indeed the future is bright with versioned stdlib.
> Breakage can be OK, if done deliberately and in a 'nice' way for the 
> user to deal with; and versioning deliberately prevents breakage.
> 
>>> Is the user expected to completely migrate to use std.v3, or should 
>>> he use a mix of std.v1, std.v2, std.v3?
>>
>> Up to them.
> 
> This is a big statement. For me this means:
> - v1 support is 'everlasting' and bugfixes will keep landing there too.

In the proposed scheme the marginal cost of keeping v1 around is very 
low. I'd say it's worth keeping it around until it becomes obsolete.

> - v2, v3, v4 will contain _all_ functionality that v1 has, and version x 
> may be somewhere halfway on the path between v1 behavior and end goal 
> behavior (e.g. some functions still do autodecoding and others don't).

That is correct. A fully release version worth announcing and advising 
users to switch to will offer all amenities v1 does, under hopefully a 
much better API. Once a new version is released, the only rationale to 
use it concurrently with the old one is during migration of user codebase.

> Another path would be to only add to v2 the functions that have changed, 
> and for functionality that did not change the user should keep using v1.

This is what effectively happens in the implementation. But all names 
will be available under the new version. It would be onerous to ask 
users to use "std" for some artifacts and "std.v2" for others. Just use 
"std.v2" everywhere and you know you've migrated.

>>> Will there be autodecoding functions in v3?
>>
>> Probably not. But there will be decoding functions in v3.
> 
> Removing the "auto" part sounds very good indeed.

Can't wait!


More information about the Digitalmars-d mailing list