I am creating this issue as question (/proposal):
What if we merely rename nocmodl generated file .cpp instead of .c?
Would this be a problem?
- As C++ is backward compatible with C (almost!), we don't expect MAJOR problem with such change (see this and this).
- People can still use their models as it is. nrnivmodl will compile all generated files with CXX instead of CC. Rest remain same.
Well, one can come up with cases which compile with CC but not using CXX. But I think changes required are always result into better code. This can be discussed / debated in detail based on our models in ModelDB.
What will be benefit?
- One of the major benefit will be VERBATIM blocks:
- we will be able to use C++ instead of C in verbatim blocks. See example of this MOD file where memory management became so convoluted. If we can use C++ (e.g. vectors), it will become so much simple.
- even though we want to avoid VEBATIM blocks, today we often need them to interface with external libraries. if we can write (modern) C++ code, I believe such MOD files can become much more compact and nicer.
- when we interface with any C++ library (e.g. SONATA), we have to always create new C bindings to use with MOD files. With .cpp file, this will be avoided.
cc : @ohm314 @ramcdougal
I am creating this issue as question (/proposal):
What if we merely rename nocmodl generated file
.cppinstead of.c?Would this be a problem?
What will be benefit?
cc : @ohm314 @ramcdougal