My Long Term Vision for the D programming language

rikki cattermole rikki at cattermole.co.nz
Sat Nov 20 05:51:17 UTC 2021


On 20/11/2021 6:13 PM, tsbockman wrote:
> 2) To specify APIs independent of implementation, for `extern` linking, 
> `interface`s and base `class`es with multiple implementations that might 
> imply different attributes, etc.

Indeed, there is no way around that. The compiler can emit them for .di 
files though.

> Attribute soup is unavoidable for (2) public APIs in general; there is 
> nowhere else the information *can* come from in many cases except from 
> an explicit specification, regardless of how sophisticated the compiler is.
> 
> Redundant specification of attributes for (1) verification purposes 
> could be dropped, but I'd rather not since I find the compiler 
> frequently catches mistakes or fuzzy thinking on my part by comparing 
> explicit attributes to inferred.

If it works for you, go for it.

But this approach does not make memory safety easy. It makes it harder 
for the majority of people and that is the problem.


More information about the Digitalmars-d mailing list