by moloch-hai · 3y ago · 0 comments
If, to use it, you need C++, it's a C++ system, period. If parts are in C, that is an implementation detail, and is furthermore pointless; modernizing those to C++ would make them more robust and probably faster. Using C anywhere just makes it as bug-prone in those parts as C code everywhere is.
C and C++ are different languages, you can't necessarily treat a codebase of mixed C and C++ as if it were written entirely in C++.
This isn't purely academic, either. For a long time the MSVC compiler had pretty good C++ language support but surprisingly poor C support, which inconvenienced some folks.
> modernizing those to C++ would make them more robust and probably faster
I agree that adopting C++'s insistence on explicit type conversions is a good move for C codebases. I'd be surprised if performance were improved by reworking a C codebase to get it to compile as C++, though.
C++ code going faster than the C is routine. It doesn't come without activity, but the activity yields a more maintainable system, so is commonly done.
MSVC's C compiler only recognized C90. It was generally easier to make your C99 code compile as C++ than to backport it to C90.
He clearly means that he used two languages: C and C++.
"I decided to reimplement the inference of the model from scratch using C/C++. To achieve this I implemented a minimalistic tensor library in C and ported the high-level architecture of the model in C++."
implemented a minimalistic tensor library in C
ported the high-level architecture of the model in C++
The C part - which accounts for most of the lines of code - may be of interest to someone who wants to use it as the foundation for implementing a different model - not necessarily in C++Yes there is.
Take the union of C and C++ which is valid syntax (and same semantics) in both languages, voila; C/C++.