Modern interface to interpreted languages

Is there a plan to create a modern Fortran interface to the interpreted languages, such as Python and R? The interface should be straightforward and efficient.

No matter how many new features are to be added, Fortran will never be as straightforward and popular as the interpreted languages. A good strategy for Fortran to survive is to integrate it with the interpreted languages. This will buy Fortran some time and allow Fortran to still remain relevant before the generics feature is available.

3 Likes

@certik. There are plans to include automatic python wrappers with LFortran.

The idea is to use information from the compiler to generate a Cython interface to the fortran. It should be possible to wrap every fortran feature, including derived types with procedures.

I’ve done a little brainstorming about how to wrap Fortran with Cython: GitHub - Nicholaswogan/fortran-cython-examples .

2 Likes

My library gfort2py GitHub - rjfarmer/gfort2py: Library to allow calling fortran code from python provides a straightforward interface between python and gfortran (no need to edit your Fortran as long as it’s all inside modules, but it is tied to gfortran). Has some rough edges at the moment but i’m also doing a fairly comprehensive rewrite at the moment.

3 Likes

@rfarmer thanks for the post and welcome!

Yes, it is our plan to include this in LFortran, here are some relevant issues:

2 Likes