First Draft: Static Single Assignment

Kapendev alexandroskapretsos at gmail.com
Fri Nov 28 06:50:52 UTC 2025


On Friday, 28 November 2025 at 05:41:42 UTC, Peter C wrote:
> On Friday, 28 November 2025 at 02:11:55 UTC, Kapendev wrote:
>> On Thursday, 27 November 2025 at 22:14:08 UTC, Peter C wrote:
>>> On Thursday, 27 November 2025 at 19:41:18 UTC, Jonathan M 
>>> Davis wrote:
>>>>
>>>> ..
>>>> - Jonathan M Davis
>>>
>>> The 'real' motivation seems clear to me: It's a proposal for 
>>> a minimalist, pragmatic implementation of single-assignment 
>>> semantics in D.
>>
>> The minimalist and pragmatic thing would be to not make it 
>> part of the language and let tooling handle it. Less work for 
>> everyone, core D devs don't have to do something and users 
>> don't have to learn and work with one more const-like keyword.
>
> When 'final' (or 'fixed' as I prefer it) appears, it documents 
> intent and becomes part of the public contract.
>
> This is not something that should be left to a linter.
>
> It's a semantic guarantee, not just a style hint, and so needs 
> to be a compile‑time contract.

Example:

```d
//+ fixed
auto b = 420;
b = 68 + 1;
```

```
fixed-checker project/source
# Or: fixed-checker project/source/app.d

Error(source/app.d:999): Can't change variable `b` with `+fixed` 
comment.
```

It's better to keep some things outside of the language sometimes 
just to keep things simple. Don't have a source, but I would say 
that people new to D already find `const` and `immutable` a bit 
confusing.


More information about the dip.development mailing list