https://github.com/atilaneves/DIPs/blob/editions/editions.md
Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 02 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | Okay changes I need to work on soon-ish: 1. Module declaration 2. __EDITION__ 3. Edition prefix switch What I expected it to be. Also: "Optional links to reference material such as existing discussions, research papers or any other supplementary materials." And that prior work section has no information about it. Should cover C# and Java too. |
April 01 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On Tuesday, 1 April 2025 at 16:21:59 UTC, Atila Neves wrote: >https://github.com/atilaneves/DIPs/blob/editions/editions.md Glad to see you are still working on this. Two lines might need some clarification:
My reading is that if you don't opt-in to a specific edition, then you use the current edition. So #2 is a little confusing because if new editions introduce breaking changes, then you have to opt-in to use the prior edition to avoid the breakage. If you have opted-in to editions and you are only keeping around the last N editions, then when the number of editions is larger than N, support for initial editions will get dropped. This also implies that there will be breaking changes/deprecations. If you really want to avoid breaking changes/deprecations, you can also keep last N editions plus the initial edition. You can also optionally strike new ones every couple of years that are meant to be kept around. That last bit depends on how often we get these new editions. In the paragraph below you say "current original edition" but I think you just mean "current edition". The last sentence could probably be folded into the first sentence, or otherwise simplified since it covers a bit of what is in the first sentence. Existing modules without this optional declaration but that have a module declaration are considered to target the current original edition. That is: they will be compiled as if the editions feature did not exist. Modules without a module declaration would be considered to be using the latest edition unless the default edition is specified explicitly with a command line argument. |
April 01 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On Tuesday, 1 April 2025 at 16:21:59 UTC, Atila Neves wrote: >https://github.com/atilaneves/DIPs/blob/editions/editions.md D is not go/rust/c++/c#, can it afford this much maintenance burden that editions will bring? I personally don't think so |
April 02 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On Tuesday, 1 April 2025 at 16:21:59 UTC, Atila Neves wrote: >https://github.com/atilaneves/DIPs/blob/editions/editions.md >Modules without a module declaration would be considered to be using the latest edition unless the default edition is specified explicitly with a command line argument. Why? I see no reason that they shouldn't behave like the modules with editionless declaration at the top. >Another compiler switch to aid transitioning that this DIP recommends is a -E switch which would function like -I for imports but would allow the user to specify what the edition should be for those imports. Does this override the edition at the module declaration? >This DIP proposes that editions can only be officially released, i.e. finalised, when druntime and phobos can be transitioned to it. Of course they have to support the new edition, but why would they have to transition to the edition themselves? Seems extra work for no good reason. All in all, I strongly support this DIP. |
April 07 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dukc | On Wednesday, 2 April 2025 at 12:52:59 UTC, Dukc wrote: >On Tuesday, 1 April 2025 at 16:21:59 UTC, Atila Neves wrote: >https://github.com/atilaneves/DIPs/blob/editions/editions.md >Modules without a module declaration would be considered to be using the latest edition unless the default edition is specified explicitly with a command line argument. Why? I see no reason that they shouldn't behave like the modules with editionless declaration at the top. I think this might be my fault. In a long-ago review of the original editions, my concern was about playground code, or simply trying out the langauge. Instead of having to first learn how to specify editions, one should be able to use the language as it is currently specified. Basically, if you write a hello world program, or play with features, they should operate as documented, not as they were 2, 3, 10 years ago. My recommendation was that the compiler would default to using the current edition, if no edition was specified on the module. However, dub would behave differently and specify a default edition that is the pre-edition edition. This way, the thousands of dub configurations out there that existed before editions existed would default to the language at that level. However, it seems this proposal goes a step further, and I agree, a confusing one. It is not hard to evolve playground code into a level that requires adding module declarations. I don't see why these need to be for the OG edition. I think the default edition if none is specified should always be the latest. You can always change that with a compiler switch. > >Another compiler switch to aid transitioning that this DIP recommends is a -E switch which would function like -I for imports but would allow the user to specify what the edition should be for those imports. Does this override the edition at the module declaration? I would say no. The purpose of this is for build systems to allow setting the default edition package-wide. Think of a dub package you are using that uses edition 2025, but you are on edition 2026. There are no edition specifiers in the modules, it's done all through the build system (dub). So when you import those modules, you need to specify the default edition just for those imports. -Steve |
April 07 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On Tuesday, 1 April 2025 at 16:21:59 UTC, Atila Neves wrote: >https://github.com/atilaneves/DIPs/blob/editions/editions.md Perl's use version should be included as prior work. Perl has One possibly way to bound this complexity could be to only support the last N editions, for N < 5. I think that should be decided at the time the edition is added. For instance, one of your examples is |
April 07 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lance Bachmeier | On Monday, 7 April 2025 at 15:20:54 UTC, Lance Bachmeier wrote: >Perl's use version should be included as prior work. Perl has Forgot to add: |
April 09 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Monday, 7 April 2025 at 03:43:58 UTC, Steven Schveighoffer wrote: >On Wednesday, 2 April 2025 at 12:52:59 UTC, Dukc wrote: >On Tuesday, 1 April 2025 at 16:21:59 UTC, Atila Neves wrote: >https://github.com/atilaneves/DIPs/blob/editions/editions.md >Modules without a module declaration would be considered to be using the latest edition unless the default edition is specified explicitly with a command line argument. Why? I see no reason that they shouldn't behave like the modules with editionless declaration at the top. I think this might be my fault. In a long-ago review of the original editions, my concern was about playground code, or simply trying out the langauge. It seems I got this question a bit wrong. I somehow thought Átila was proposing that no declaration => current edition, editionless declaration => one specified by switch, the latest one by default. But in fact the DIP proposes the reverse. So to be clear IMO the latest edition should always be the default. Not the present one. It's dead easy to add |
April 14 Re: Editions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | On Tuesday, 1 April 2025 at 16:31:49 UTC, Richard (Rikki) Andrew Cattermole wrote: > Okay changes I need to work on soon-ish: > > 1. Module declaration > 2. __EDITION__ > 3. Edition prefix switch ? > What I expected it to be. ?? > "Optional links to reference material such as existing discussions, research papers or any other supplementary materials." I don't know of any. > Should cover C# and Java too. ??? |