Static typing, Python, D, DbC

John Nagle nagle at animats.com
Mon Sep 13 00:47:26 EDT 2010


On 9/12/2010 7:50 PM, Paul Rubin wrote:
> Ed Keith<e_d_k at yahoo.com>  writes:
>>> I think DbC as envisioned by the Eiffel guy...
>>> the term is that it's a static verification technique,
>>
>> Eiffel throws an exception when a contract is violated. That is run
>> time behavior, not static verification.
>
> The runtime checks are for when static analysis hasn't been supplied
> (that is usually a partly manual process).  DBC is always intended to be
> statically verified as I understand it.  Doing it at runtime is just a
> hackish fallback.

    Right.

    Static verification is finally a production technology.  All signed
Windows 7 drivers must pass Microsoft's static checker, which checks
that they don't have bad pointers and call all the driver APIs
correctly.  That's real "design by contract".

    It's not that relevant to Python, where you can't crash the
underlying system.  But it really matters in languages where you can.

				John Nagle




More information about the Python-list mailing list