-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should all implementations be placed in submodules? #540
Comments
It makes sense to me, I agree. Another advantage to submodules in their own source files is that the implementations that are independent from one another could be compiled in parallel. |
There is an abbreviated version of submodules that I think should be avoided. Here is an example of it from the Fortran Wiki:
I don't want to guess a procedure's arguments or look at another source file for them. |
A few issues semi-related to submodules:
Besides avoiding compilation cascades during development, another benefit of submodules is the reduction in memory usage during compilation (see #283). Another important usage of submodules would be to swap between implementations with different backends or performance tradeoffs. Some examples:
|
From @milancurcic in #539:
On the long term I think the public modules should contain only the interfaces, and all of the implementation should be placed in sub-modules. This would facilitate compiler vendors providing their own optimized implementations in the (distant?) future. It would also make it easier to swap between debug and release binaries by re-linking. I think the current reasoning was simply when launching a new module with a small function, it was just easier to prepare a single module.
A second reason in favor of separating interface and implementation might be to use a stdlib library compiled by another Fortran compiler. In this case you would only need to compile the interface (see #530 (comment) and the discussion that follows). As an example, Intel MKL ships libraries that can be used with both Intel and gfortran compilers.
Originally posted by @ivan-pi in #539 (comment)
The text was updated successfully, but these errors were encountered: