D Editions

Mike Shah mshah.475 at gmail.com
Fri Dec 20 19:29:26 UTC 2024


On Thursday, 19 December 2024 at 16:53:41 UTC, Atila Neves wrote:
> On Thursday, 6 June 2024 at 16:59:27 UTC, Timon Gehr wrote:
>> On 6/2/24 02:39, Steven Schveighoffer wrote:
>>>> - How do function interfaces work when some type annotations 
>>>> exist in only either the language edition of the caller or 
>>>> the language edition of the callee? E.g. think DIP1000 is in 
>>>> one edition but not in another.
>>> 
>>> The type annotations are defined by the language edition for 
>>> the imported module. So those would be in effect.
>>> 
>>> In other words, this is not like today where you compile one 
>>> module with dip1000 and another module without, and the 
>>> compiler blindly assumes all are compiled the same way.
>>> 
>>> This does introduce an interesting wrinkle -- if there are 
>>> differences, newer editions *must define* the interactions 
>>> like this between editions as part of the release.
>>> 
>>> -Steve
>>
>> Should be in the DIP.
>
> I just tried to put it in the DIP but I'm not sure what the 
> wording should be.

Just wanted to share here this discussion on editions in Rust 
that I listened to:
https://softwareengineeringdaily.com/2024/10/23/rust-vs-c-with-steve-klabnik-herb-sutter/

At ~35:10 to 41:41 minute mark Herb Sutter asks specifically 
about editions and applying what Rust has to C++. He asks some 
stuff about fundamental changes (e.g. changing private to public 
defaults) and what is and is not possible.

Apparently Rust is doing editions through the intermediate 
representation in their edition mechanism (This seems to be 'per 
project' instead of 'per module' as I understand this DIP.).

The Rust strategy seems to answer some of the question of what 
happens when libraries change, and how to ultimately get code to 
talk (and again, focusing on just a 'per project' level and 
having one single Rust compiler seems to make this a lot easier). 
Ultimately the Rust standard library seems to have 1 'edition' 
however, which I imagine does not increment its edition 
frequently.

Anyway, just wanted to share, as that helped frame my 
understanding of editions.


More information about the dip.ideas mailing list