comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: On contracts and implementations
Date: Thu, 11 Jul 2013 16:15:44 +0200
Date: 2013-07-11T16:15:44+02:00	[thread overview]
Message-ID: <ritnah9zekwf.1fskbxkxmrezv.dlg@40tude.net> (raw)
In-Reply-To: ieWdnXSAKPXPAEPMRVn_vwA@giganews.com

On Thu, 11 Jul 2013 07:56:02 -0400, Peter C. Chapin wrote:

> On 07/11/2013 05:35 AM, G.B. wrote:
> 
>> There is a claim that contracts of Ada 2012 are part of the
>> implementation. They are not.
> 
> I think the litmus test for contract code vs "ordinary" code is that the 
> contracts should be removable without changing the functional behavior 
> of the program. This means that any checks of errors arising from the 
> execution environment, such as missing files or bad user input, can't be 
> in contracts.

Right

> It is important to be able to remove contracts for performance reasons. 
> I'm not talking about the constant time overhead of extra range checks. 
> I'm talking about major performance costs.

It is in contradiction with the above. Since contract checks may have no
effect on program semantics, they cannot be executable. Of course they can
be removed, because they never were inserted in first place.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2013-07-11 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11  9:35 On contracts and implementations G.B.
2013-07-11 11:56 ` Peter C. Chapin
2013-07-11 14:15   ` Dmitry A. Kazakov [this message]
2013-07-11 16:14     ` G.B.
2013-07-12 21:30   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox