[OT] Dear Google Cloud: Your Deprecation Policy is Killing You
SeeWebsiteForEmail at erdani.com
Wed Aug 19 13:46:31 UTC 2020
On 8/18/20 6:43 PM, H. S. Teoh wrote:
> Things like integer
> promotion, for example, cannot be changed without causing breakage, no
> matter how you try to do it. Fundamental things of this nature will
> basically have to remain the way they are forever.
I disagree. There are cases in which it's possible to surgically remove
the bad cases and keep the good cases. We've done that a few times:
* We managed to effectively remove all "bad" uses of the comma operator
and keep all "good" uses. It went over very smoothly. The rule we
introduced was you can't use the result of the comma operator.
* We improved comparison operators by simply making them
non-associative. This made chained comparisons such as a<b<c illegal
without otherwise impacting semantics.
* We got rid of the dilemma between using a ton of casts among integral
sizes, and allowing lossy conversions. That also went over very
smoothly. This does not compile:
ubyte b = array.length;
But this does:
ubyte b = array.length & 0xff;
(Interesting detail, the generated code doesn't even contain the "&":
So there is opportunity, we just need to carefully search for it.
On the face of it, the bad cases of integral promotion concern
converting negative integrals to unsigned integrals. I don't think we
apply Value Range Propagation there. If we did, presumably we could
eliminate at least some bad cases without impacting the good cases.
More information about the Digitalmars-d