December 26
On Monday, 23 December 2024 at 18:07:45 UTC, Timon Gehr wrote:
> On 12/19/24 17:52, Atila Neves wrote:
>> On Thursday, 6 June 2024 at 15:47:50 UTC, Timon Gehr wrote:
>>> [...]
>> 
>> Why do we need to compile all of them? Do we need something like `__traits(callerEdition)` maybe?
>> ...
>
> It may not be known at library compile time what edition the user will be using, and there may be multiple different users on different editions.

Right, but not all edition-specific branches will need to compile in any one given compiler pass, right?

> Maybe, though it does invalidate memory safety guarantees. Another way to deal with it is to require something like `@trusted import` for such modules or to otherwise treat all `@safe` imports from that module as `@system`.

I like both of those ideas.

>> Maybe there will be changes we won't be able to make.
>> 
>
> Maybe, though I think one thing that will often work is to make such calls `@system`.

Right.

December 28
On 12/26/24 10:55, Atila Neves wrote:
>>
>> It may not be known at library compile time what edition the user will be using, and there may be multiple different users on different editions.
> 
> Right, but not all edition-specific branches will need to compile in any one given compiler pass, right?

Well, I think if a library wants to branch on the edition of the caller, all of those branches would need to be compiled when the library is compiled. (Think druntime.)

Of course, the case where a library wants to branch on its own edition is separate. There, not all branches will need to compile on any given compiler invocation, though I am not sure that this is an important case (as usually every piece of code just targets a specific edition).

December 30
On Saturday, 28 December 2024 at 02:03:57 UTC, Timon Gehr wrote:
> On 12/26/24 10:55, Atila Neves wrote:
>>>
>>> It may not be known at library compile time what edition the user will be using, and there may be multiple different users on different editions.
>> 
>> Right, but not all edition-specific branches will need to compile in any one given compiler pass, right?
>
> Well, I think if a library wants to branch on the edition of the caller, all of those branches would need to be compiled when the library is compiled. (Think druntime.)
>
> Of course, the case where a library wants to branch on its own edition is separate. There, not all branches will need to compile on any given compiler invocation, though I am not sure that this is an important case (as usually every piece of code just targets a specific edition).

Ok. What do you propose we do, then? Because AFAICT none of the current mechanisms will work for this.
5 days ago
On 12/30/24 16:49, Atila Neves wrote:
> On Saturday, 28 December 2024 at 02:03:57 UTC, Timon Gehr wrote:
>> On 12/26/24 10:55, Atila Neves wrote:
>>>>
>>>> It may not be known at library compile time what edition the user will be using, and there may be multiple different users on different editions.
>>>
>>> Right, but not all edition-specific branches will need to compile in any one given compiler pass, right?
>>
>> Well, I think if a library wants to branch on the edition of the caller, all of those branches would need to be compiled when the library is compiled. (Think druntime.)
>>
>> Of course, the case where a library wants to branch on its own edition is separate. There, not all branches will need to compile on any given compiler invocation, though I am not sure that this is an important case (as usually every piece of code just targets a specific edition).
> 
> Ok. What do you propose we do, then? Because AFAICT none of the current mechanisms will work for this.

I am not sure.

One simple idea that came to mind would be to add an `__EDITION__` special identifier that is evaluated in the caller's scope, similar to `__LINE__` and `__FILE__`, but that seems like only a partial solution.

Perhaps what would work better would be a visibility attribute that says "only visible from this edition/these editions".

Then you can e.g. have different declarations and alias them using aliases that have the correct visibility attributes.

Of course, interoperability is a concern, but that would be up to the library author.
4 days ago

On Thursday, 30 May 2024 at 18:31:48 UTC, Atila Neves wrote:

>

https://github.com/atilaneves/DIPs/blob/editions/editions.md

Destroy!

My opinion on this remains the same as it was when I wrote "Thoughts on Backward Compatibility"; to wit:

  • Even without an edition bump, small-scale breaking changes with easy migration paths aren't a big deal.
  • Even with an edition bump, large-scale breaking changes that make migration difficult should probably be avoided.

In other words: the presence of editions in a language does not really make a difference w.r.t. which kinds of breaking changes are feasible to introduce.

Since the stated purpose of editions is to make it easier to introduce breaking changes, I believe that this flaw renders the entire proposal unfit for purpose.

2 days ago

On Tuesday, 14 January 2025 at 05:27:10 UTC, Paul Backus wrote:

>

On Thursday, 30 May 2024 at 18:31:48 UTC, Atila Neves wrote:

>

https://github.com/atilaneves/DIPs/blob/editions/editions.md

Destroy!

My opinion on this remains the same as it was when I wrote "Thoughts on Backward Compatibility"; to wit:

  • Even without an edition bump, small-scale breaking changes with easy migration paths aren't a big deal.
  • Even with an edition bump, large-scale breaking changes that make migration difficult should probably be avoided.

In other words: the presence of editions in a language does not really make a difference w.r.t. which kinds of breaking changes are feasible to introduce.

Since the stated purpose of editions is to make it easier to introduce breaking changes, I believe that this flaw renders the entire proposal unfit for purpose.

This. There is something implicitly said in your post, though: Medium-scale breaking changes with non-trivial migration paths. For those, editions shine. A simple example might be the introduction of a new keyword.

2 days ago

On Thursday, 16 January 2025 at 01:08:17 UTC, Quirin Schroll wrote:

>

This. There is something implicitly said in your post, though: Medium-scale breaking changes with non-trivial migration paths. For those, editions shine. A simple example might be the introduction of a new keyword.

"Medium" is what "large" calls itself when it doesn't want to admit it's gained weight. If it's disruptive enough to require an edition bump, it's "large."

For something like a new keyword, whether it's feasible or not depends entirely on what the keyword is. For example, we just added __rvalue without an edition bump or even a preview switch, and nobody expects it to cause any problems. OTOH, if you wanted to add a match keyword, I do not think you could do it even with an edition bump.

17 hours ago

On Thursday, 16 January 2025 at 17:01:40 UTC, Paul Backus wrote:

>

On Thursday, 16 January 2025 at 01:08:17 UTC, Quirin Schroll wrote:

>

This. There is something implicitly said in your post, though: Medium-scale breaking changes with non-trivial migration paths. For those, editions shine. A simple example might be the introduction of a new keyword.

"Medium" is what "large" calls itself when it doesn't want to admit it's gained weight. If it's disruptive enough to require an edition bump, it's "large."

For something like a new keyword, whether it's feasible or not depends entirely on what the keyword is. For example, we just added __rvalue without an edition bump or even a preview switch, and nobody expects it to cause any problems. OTOH, if you wanted to add a match keyword, I do not think you could do it even with an edition bump.

Well, __rvalue essentially was a keyword as all __stuff are reserved.
Why we couldn’t add match as a keyword in an edition is beyond me.
You can always rename your variables in old code when you decide you’re ready for the next edition.

7 hours ago

On Saturday, 18 January 2025 at 05:28:59 UTC, Quirin Schroll wrote:

>

Why we couldn’t add match as a keyword in an edition is beyond me.
You can always rename your variables in old code when you decide you’re ready for the next edition.

match is already widely used as a function name, in a variety of different contexts:

https://search.dpldocs.info/?q=match

If we make match a keyword, these existing libraries will not be able to migrate without making breaking API changes. Which means that any new projects that want access to these libraries will be forced to choose the old edition instead of the new one.

The purpose of editions is to allow new projects to benefit from language updates without affecting existing projects. If we end up in a situation where even new projects are choosing the old edition, it seems to me that we will have utterly failed in our mission.

1 2 3 4 5 6 7
Next ›   Last »