D Editions
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Sat Jun 1 02:37:33 UTC 2024
On Friday, May 31, 2024 6:30:36 PM MDT Gregor Mückl via dip.ideas wrote:
> This brings me to a follow-up question: how can e.g. druntime
> evolve in this framework? Its public interface (e.g. the object
> class) needs to always stay compatible with *all* editions the
> compiler supports at that time, right?
Mostly, yes, druntime will be kind of stuck. In some cases, we should be
able to make compatible changes - e.g. we've discussed putting a new base
class under Object so that we can move away from a base class that has
functions like opEquals on it and potentially get rid of the monitor; so new
code would be able to use the new base class instead, but old code would
continue to use Object. However, some changes may not be possible, because
we won't be able to do them in a way that doesn't break old Editions (e.g.
Object itself will likely maintain its current set of functions). We may
also find more creative ways to over time to maintain compatability via
compiler tricks (e.g. we could theoretically play games and make it so that
Object still had opEquals and friends for older Editions, but they wouldn't
be accessible for newer Editions even though they'd technically still be
there underneath the hood; I don't think that we're going to do that, but
there may be things like that that we do at some point so that the same code
will work for multiple Editions while still allowing us to make breaking
changes).
There's also some possibility that we will eventually start deprecating
Editions once they're old enough, which might enable us to make larger
changes, but that's not the current plan.
And in some cases, we should be able to change functionality by versioning
it based on the Edition, but since druntime as a whole will need to be
provided as a single library, there will definitely be limitations with that
(particularly for code that isn't templated). Fortunately, _most_ stuff
shouldn't be limited by that, but even when it is, Editions will still allow
us to change a lot more than we can reasonably change right now. So, the
situation is not without its downsides, but it should be an improvement
overall.
- Jonathan M Davis
More information about the dip.ideas
mailing list