DIP 1034--Add a Bottom Type (reboot)--Formal Assessment Begins

John Carter john.carter at taitradio.com
Wed Feb 3 19:51:43 UTC 2021


On Wednesday, 3 February 2021 at 18:24:06 UTC, Imperatorn wrote:
>
> Is there a short explanation of why this was done and what it 
> enables?
>

Personally I'm excited to see this...

Strangely enough there is a long running 'net wide disagreement 
on what an assert is or does.

Some regard it as purely a debugging tool used as a programmer 
aid that is expressly turned on by the programmer, and others 
(such as myself) regard it as a way of stating, and enforcing the 
contract, provided by an API.

And as such, people with the latter mindset wish the compiler 
would warn us if that contract is potentially violated on any 
path, and conversely, wish the optimizer to act on the 
information it provides.

By adding it to the type system, it expresses and clarifies the 
intent of the author of the code, and expresses it in the 
compilers terms, ie. a type.

In my day job, I have found the only resolution to the 
disagreement is to create two different facilities with two 
different names to permit the two groups of humans to get along.

In my day job instead of "assert" we now have "log_If....()" that 
are opt-in programmer debugging tools and "error_Check...()" that 
enforce.


More information about the Digitalmars-d-announce mailing list