Re:Moving to a provenance-aware memory object model for C: p...
by 0815test on Sunday April 14, 2019 @02:03PM
(#19660745)
> Compile-time code/type generation and verification
Rust does have a procedural macro system which can be used to do these things. Surely actual procedural macros are better than hacking the template system to generate custom code, which is the typical approach in C++.
Re:Moving to a provenance-aware memory object model for C: p...
by jandrewrogers on Sunday April 14, 2019 @02:15PM
(#19660801)
This is not remotely the same. You are seriously underestimating the capabilities of C++17 in this regard.
Re:Moving to a provenance-aware memory object model for C: p...
by JoachimSchipper on Wednesday April 17, 2019 @04:02PM
(#19685955)
Do you happen to have a link to a page explaining these techniques? I code in C and dabble in Rust, but this sounds interesting.
(Sorry, I know this is a few days old by now...)
This is fairly magical when you use it but it requires a different coding style than some systems programmers are used to. Instead of writing code, you end up writing a lot of meta-code that generates and verifies what actually gets compiled. Recent versions of C++ have invested a lot in making these facilities expressive and reasonable to use in complex software. In my experience this has substantially reduced the code defect rate and simplified testing. Once you've written a system this way, it is very hard to go back.
Not having these facilities would be a huge step backward for writing practical high-assurance/high-reliability code. AFAICT, Rust is still quite primitive in this regard.