3 ms·
I assumed the C ABI, and thus the cobbled-up vtables. Where the author might have used C++ to advantage would be automating other, internal details of the code.
by ncmncm 5y ago
I assumed the C ABI, and thus the cobbled-up vtables. Where the author might have used C++ to advantage would be automating other, internal details of the code. There is nothing quite like bugs you don't have because you didn't need to write the code where they would have been, or because you could run code at compile time to generate or at least verify your cobbled-together apparatus.
The saving grace is that it can at any time be switched over to be built with a C++ compiler, and then start to be modernized incrementally.
- nyanpasu64 5y agoWhat you say is true. Unfortunately I don't think you can trivially switch it to a C++ compiler, because they use {[FOO] = ...} initialization. It would be cool (not necessarily useful, probably not a good use of time) to rewrite it in Rust while keeping the dependency count in the single digits. It would be helpful to contributors to add architectural documentation.
- jcelerier 5y agoClang supports it in C++ mode but not GCC sadly :(
- ncmncm 5y agoC++ has a version of that notation, with minor (and IMHO unnecesssary) restrictions that probably impose no hardship.
- nyanpasu64 5y agoC++20 added dot initialization, which has been supported in MSVC/GCC/Clang for over a year now. No released version of the C++ standard supports array index initialization, and jcelerier says Clang but not GCC supports it as an extension.