Thoughts about D
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Thu Nov 30 04:49:00 UTC 2017
On Wednesday, November 29, 2017 20:08:53 Walter Bright via Digitalmars-d
wrote:
> On 11/29/2017 8:02 PM, Jonathan M Davis wrote:
> > Well, given that assertions would normally be used in a debug build
> > where
> > you generally don't optimize, and the debug symbols are compiled in, I
> > wouldn't think that that would matter much in most cases.
>
> I want them in the release build, which means they should be at minimal
> cost.
Well, we could always have an alternate implementation of assertions for
release builds that acted closer to C's assert. We already transform
assert(0) into something else with -release. In general, for debugging, I'd
much prefer to have D's assert as it is now, but I don't see any reason why
we couldn't do something differently with a flag like -release but which
specifically made assertions more primitive and lightweight for a release
build rather than removing them for those folks that want to leave
assertions enabled in a release build. Personally, I wouldn't want to enable
assertions in the release build of most stuff, but some folks definitely
have expressed the sentiment that they don't like the -release flag being
named what it is, because they don't think that assertions should be
disabled for release builds.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list