Ticket #11 (assigned enhancement)
Selective DbC Compilation
Reported by: | Steve | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
When creating development code, one usually needs to make full use of preconditions, postconditions and invariants. The latter two help to prove that the algorithms in classes work as expected.
In production code, the algorithms should be proven out to the best of the developers capabilities, and postconditions/invariants should no longer be needed. Because they imply overhead in terms of performance and size, it is beneficial to remove them.
Preconditions though are always desirable because a class has no way of anticipating who its clients will be.
My proposal is that command line options be added to Cobra to specify what assertions be compiled into the resultant application or library, but it isn't clear to me how these would look. Ideally it would be nice to have something similar to this:
-contract:none
-contract:all
-contract:pre,post