First release of the Fortran standard library

Right. I am not worried about the warnings (which can be fixed one way or another — however indeed things should build cleanly, so we do have to fix it), but this is indeed a real problem.

It seems generating all array ranks and types and kinds like that indeed introduces too much bloat which is unsustainable in practice.

It’s an interesting idea to deduce what instantiation have to happen from undefined symbols. But it seems we need to be able to reliably obtain those on all platforms, and then hook it in a feedback loop. And every Fortran compiler has different name mangling, so we would also have to take that into account. We could probably teach fpm to do that. However in modern Fortran things would not even compile if the given (overloaded) subroutine is not available in the module. So I don’t even know if this is technically doable. We could infer from the compiler error messages what needs to be built.

A more technically sound idea is to implement generics in LFortran, and then LFortran can “instantiate” only what is needed for a given project and write it down as Fortran source file, then one can use any Fortran compiler to compile. And we can integrate the LFortran’s library with fpm, so that fpm does this automatically under the hood.

Still, I am not happy with the solution. I would like to just distribute Fortran sources of the stdlib library that just work, no hacks or code generation required. But I don’t know how.

5 Likes