On 10/28/21 7:30 AM, Ogi wrote:
>On Tuesday, 26 October 2021 at 06:05:08 UTC, bauss wrote:
>The only problem I see when versioning the standard library is that some packages will rely on specific versions of the standard library and it could make it difficult to use packages that rely on different versions of the standard library.
You’re saying it like it’s not a big deal but I’m afraid it’s going to be a huge source of pain. Imagine not being able to get some DateTime
, or Complex
, or File
from one package and pass it to another because one depends on std1
and the other depends on std2
. Or imagine dealing with different versions of the same exception class. It appears to me that versioning the standard library is a bullet train straight to dependency hell.
Yes, this is a part that is not being considered. We have clues as to how hellish it will be with experience in using Windows DLLs which have their own independent copy of the runtime (and all the "same but not same" TypeInfo
instances).
And there is the problem with string
actually being the same type in both libraries but doing completely different things (autodecoding).
I'm wondering, if we did things like you do database migrations, if it might help (with the former problem). That is, if you pass a std.stdio.File
to a function accepting a std2.stdio.File
, the compiler is given a way to convert the internals/state. Something like that might make things palatable.
-Steve