# Modern interface to interpreted languages

**URL:** <https://fortran-lang.discourse.group/t/modern-interface-to-interpreted-languages/2435>\
**Category:** Help\
**Created:** [December 21, 2021, 6:16pm UTC](https://fortran-lang.discourse.group/t/modern-interface-to-interpreted-languages/2435 "2021-12-21T18:16:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fortran4r](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@fortran4r](https://fortran-lang.discourse.group/u/fortran4r)\
**Post date:** [December 21, 2021, 6:16pm UTC](https://fortran-lang.discourse.group/t/modern-interface-to-interpreted-languages/2435/1 "2021-12-21T18:16:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nicholaswogan](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@nicholaswogan](https://fortran-lang.discourse.group/u/nicholaswogan)\
**Post date:** [December 21, 2021, 6:33pm UTC](https://fortran-lang.discourse.group/t/modern-interface-to-interpreted-languages/2435/2 "2021-12-21T18:33:30Z")

</div>

@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](https://github.com/Nicholaswogan/fortran-cython-examples) .

---

<div class="post-metadata">

**Author:** ![rfarmer](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rfarmer](https://fortran-lang.discourse.group/u/rfarmer)\
**Post date:** [December 21, 2021, 6:38pm UTC](https://fortran-lang.discourse.group/t/modern-interface-to-interpreted-languages/2435/3 "2021-12-21T18:38:07Z")

</div>

My library gfort2py [GitHub - rjfarmer/gfort2py: Library to allow calling fortran code from python](https://github.com/rjfarmer/gfort2py) 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.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [December 21, 2021, 7:32pm UTC](https://fortran-lang.discourse.group/t/modern-interface-to-interpreted-languages/2435/4 "2021-12-21T19:32:08Z")

</div>

@rfarmer thanks for the post and welcome!

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

- [Automatic wrappers Fortran -\> Python (#133) · Issues · lfortran / lfortran · GitLab](https://gitlab.com/lfortran/lfortran/-/issues/133)
- [Bridge to Python and other languages (#44) · Issues · lfortran / lfortran · GitLab](https://gitlab.com/lfortran/lfortran/-/issues/44)
- [Interoperability with Python (#132) · Issues · lfortran / lfortran · GitLab](https://gitlab.com/lfortran/lfortran/-/issues/132)
- [Allow to "use" modules compiled by gfortran (#52) · Issues · lfortran / lfortran · GitLab](https://gitlab.com/lfortran/lfortran/-/issues/52)
