Comment by ahartmetz

4 days ago

On the one hand, almost everyone (including C++ fans) agrees that the language is too big. On the other hand, comtracts just formalize an existing and useful concept.

Profiles should (hopefully) rein this in by getting people to start subsetting language features in their codebases

  • Let's see, they are still a bit of a dream regarding what they wish for, and what current static analysers can achieve, especially the lifetime one.

    • I was thinking for implementing borrow-checker like rules for C but after I have seen what SMT solver can do I think it is not necessary to constrain the language in this way.

      20 replies →

Exactly. Many years ago people used to use C `struct` for objects but then that was formalized as `class`.

  • C++ "class" is the exact same user-defined type as C++ "struct" but with different defaults for privacy.

    • But C++ "struct" has many more features than C "struct". Virtual functions aka compiler-generated invisible vtables, constructors (initialization functions) and destructors (automagically called deinitialization functions), the whole templates complex of features...