Hacker News new | ask | show | jobs
by nickpsecurity 3852 days ago
"That's kind of already happened. Stroustrup has done a whole ton of work in that area with Concepts."

Wasn't aware of that. It was an interesting read. Thanks for mentioning it.

"It turns out that provable correctness invariably involves a fair bit of complexity"

I wasn't even talking about that. I just looked for static analysis tools that could reliably find common implementation flaws or interface issues with little to no false positives. These already exist for C, Java, Ada, C#, and academic languages. Similarly, some verification or foundation of standard library like Modula-3's or the one for C. I found little to nothing of any of this for C++. So, the C++ verifications would all be visual and manual unless you pay big $$$ for one of few commercial tools.

Unacceptable. Formal methods would make C++ unacceptable for even more reasons.

"This stuff goes back a way, but stemmed from Modern C++ Design."

Same book pjmp recommended. Guess the study should start with it.

"You can override operator-> to make it behave more like a proper pointer. CRTP gives you some pretty powerful ways of getting the job done too."

Interesting example. I think one test of C++'s safety would be whether such methods can provide same protections that Ada provides where applicable to both languages:

http://www.adacore.com/knowledge/technical-papers/safe-secur...

It would need to catch the problems, do it during compile phase, and do it fast enough to be productive. I heard bad things about C++ compile phase in the past, esp for template heavy code. Plus, needs design-by-contract as Eiffel and SPARK have shown. I've seen it done with asserts and object constructors/destructors so that's probably not a problem. The other stuff, esp static analysis for memory & concurrency safety, is where C++ will be judged most.