Stroustrup objects to adding Contracts to C++

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Nov 12 04:31:18 UTC 2026


For reference here is my testsuite output:

Compiler was optimized with ldc2 -O3, building tests (optimizations are 
always on), and clang is set to -O2.

pass=201 fail=0
time cailc[native/x64]=40769ms
time cailc[native/x86]=38178ms
time cailc[cpp]=30311ms
time clang=252069ms
time run[native/x64]=9598ms
time run[native/x86]=9507ms
time run[cpp]=8965ms
time suite=36304ms
slowest steps:
   clang cofunction_waitrequired_accepted.cail: 7701ms
   clang cofunction_park_merged.cail: 6403ms
   clang class_merged.cail: 5434ms
   clang cofunction_shape_merged.cail: 5395ms
   clang memory_merged.cail: 5388ms
   clang cofunction_state_merged.cail: 5342ms
   clang lang_core_merged.cail: 5130ms
   clang interop_merged.cail: 4825ms
   clang opt_shape_merged.cail: 4561ms
   clang opt_macrofuse_gen3.cail: 4516ms
slowest halt steps:
   clang assert_false.cail: 3904ms
   clang halt.cail: 3897ms
   clang enforce_false.cail: 3767ms
   clang noreturn_trap.cail: 3727ms
   clang assert_msg.cail: 3638ms
   clang cofunction_resume_past.cail: 3630ms
   clang enforce_msg.cail: 3599ms
   clang unittest_failure.cail: 2122ms
   run[native/x64] enforce_false.cail: 855ms
   run[native/x64] enforce_msg.cail: 798ms

The slow enforce tests are due to Windows and halt instruction.

Looks like my codegen has suffered a bit after some optimizations to the 
backend, *sigh* I'll have to go back and fix it.


More information about the Digitalmars-d mailing list