[OT] The Usual Arithmetic Confusions
forkit
forkit at gmail.com
Thu Feb 17 20:55:38 UTC 2022
On Thursday, 17 February 2022 at 20:11:07 UTC, Paul Backus wrote:
>
>
> Yeah, implicit signed-to-unsigned conversion is really nasty.
> Even if we keep the rest of the C-style promotion rules,
> getting rid of that one would still be a big improvement.
Implicit memory manipulation (e.g. type casting for example) can
result in unintentional memory safety bugs, which in turn can
result in adverse events. As such, it is not consistent with the
concept of memory safety.
It would be great if D had a feature whereby I could annotate a
function in such a way, that it disallowed implicit type
conversions on its input arguments.
Regardless, I think this is another reason why D is unlikely to
ever get widespread adoption. That is, the ship has sailed with
regards to the pricipals of memory safety in programming
languages, and the decisions Rust has made with regards to
inherent safety, have resulted in the kind of language features
programmers *will have to* work with in the future.
More information about the Digitalmars-d
mailing list