First Draft: Static Single Assignment

Peter C peterc at gmail.com
Tue Nov 18 21:26:50 UTC 2025


On Tuesday, 18 November 2025 at 10:24:17 UTC, Jonathan M Davis 
wrote:
> On Sunday, November 16, 2025 2:48:32 PM Mountain Standard Time 
> Peter C via dip.development wrote:
>> On Sunday, 16 November 2025 at 09:59:19 UTC, Kapendev wrote:
>> > On Sunday, 16 November 2025 at 04:16:56 UTC, Peter C wrote:
>> >> I propose intead, 'init' -  it (at least to me) directly 
>> >> evokes an initialization context for the construction of a 
>> >> variable.
>> >
>> > I don't think this is a good idea because `init` is a common 
>> > constant or function name. Not D specific also, just check 
>> > some code in other languages.
>>
>> We've had the 'init' keyword in C# for many years now.
>>
>> https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/init
>>
>> init evokes the context of initialization, which is not what 
>> C#'s 'sealed' would have done.
>>
>> 'sealed' is D's 'final' btw - and both of those invoke an OOP 
>> context (structural inheritance and type extension).
>>
>> I would have thought all the anti-oop people would have given 
>> me a +1 for suggesting 'init' instead of final ;-)
>
> 1. init is already used in D by the language itself to give the 
> value that a type is default-initialized with - e.g. T.init, 
> int.init, etc.
>
> 2. Adding _any_ keyword is a breaking change, so the odds of it 
> happening are pretty low in general. If there's a strong case 
> for it with a particular feature, then it might happen, but if 
> an existing keyword can reasonably be used instead (or some 
> other syntax which wouldn't be a breaking change), that's 
> almost certainly what's going to happen when adding a feature. 
> It _might_ happen with a new edition, but even then, it's 
> _highly_ unlikely that init would be an acceptable keyword 
> given how it's already used.
>
> So, regardless of how much sense it would or wouldn't make to 
> use init for something like this if we weren't worried about 
> breaking existing code, it's clearly not going to happen.
>
> - Jonathan M Davis

It's highly unlikely that 'init' or 'fixed' (which is now my new 
preference) .. or whatever it ends up being called, is currently 
being used in existing code as an identifier preceding the 
initialization of a variable.

It would be contextual keyword - the context being -> variable 
declaration and assignment.

The chances of an existing piece of D code having the following 
structure are extremely low:

private fixed int x = 10;



More information about the dip.development mailing list