Skip to content

Should all implementations be placed in submodules? #540

Open
@ivan-pi

Description

@ivan-pi

From @milancurcic in #539:

General question for everybody, do we have a guide on when to put a function implementation in its own submodule and when to leave it in the module? I see that we have clip in the module but the others have their own submodules.

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions