Make using compiled libs with debug code better

jfondren julian.fondren at gmail.com
Mon Oct 18 23:37:51 UTC 2021


On Monday, 18 October 2021 at 23:29:09 UTC, rikki cattermole 
wrote:
>
> On 19/10/2021 12:17 PM, Paul Backus wrote:
>> My radical idea (which I also brought up on Discord) is that 
>> we should enable *all* contract checks and asserts in release 
>> mode by default, and tell programmers to use `debug 
>> assert(...)` if they want a particular check to be removed in 
>> release builds.
>
> That isn't radical at all.

Nim has the same division, with the opposite default, in `assert` 
(erased in release builds) and `doAssert` (retained in release 
builds). D can simulate a bunch of different kinds of asserts by 
abusing dmd flags and different places that asserts can appear in 
- function bodies, contract bodies, unittests, and debug 
statements, version blocks, but what D's missing is the 
*convention* of using these asserts differently.


More information about the Digitalmars-d mailing list