Allow to "use" modules compiled by gfortran
One can compile production code with gfortran, which produces gfortran specific mod
files. Those can already be parsed by lfortran.adapters.gfortran.mod
, which creates an equivalent ASR representation of the module.
Now we just need to allow them to be used "out of the box" with LFortran simply by "using" them:
use some_mod, only: some_fun
call some_fun(5)
where some_mod
was compiled with gfortran
.
Later we can add support for other Fortran compilers also (#56).
This will allow to use LFortran with production codes right away. Simple functions in a module would work, and for more complex functionality not yet implemented by LFortran all one has to do is to write a simple module, compile with gfortran, and then use in LFortran interactively.
Note: a related project is gfort2py, which down the road can hopefully use lfortran.adapters.gfortran.mod
so that they do not have to maintain their own parser.