andri.r...@gmail.com wrote:
>
> Our current code base is largely Fortran (400K LOC, most F90/some F77/maybe
> some newer versions)
>
> We are exploring the best practice idea of taking one of those modules
> and writing it in a faster-to-develop language (Python), and wrapping
> and extending bottlenecks in Fortran.
>
> From discussions online - and my intuition, whatever that???s worth
> ??? it seems unadvised to embed Python like this, and instead do the
> reverse: extend Python with Fortran (for bottlenecks, as needed).
>
FWIW, this is the commonest pattern I am familiar with, with a top-level
glue language, such as R, calling Fortran. You have not really told
us what Python is offering you. If you are talking numeric codes,
then prototyping in one language and rewriting from scratch in Fortran
might actually be efficient, as it is one approach to testing algorithm
correctness and hopefully getting speed. I would think that you can
implement any high-level data structures like Python dictionaries in
modern Fortran. Wanting to interface Python libraries, for say graphical
input or output options, is a different question. or do you want
something fancy, like symbolic algebra?
Forpy looks really fun, btw (I was not familiar with it).
Just 2c, David Duffy.