• Tool for C++ 2 FORTRAN?

    From Arjan@21:1/5 to All on Thu May 26 23:02:28 2022
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sjouke Burry@21:1/5 to Arjan on Fri May 27 08:43:22 2022
    On 27.05.22 8:02, Arjan wrote:
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    Try a human brain.
    Those things can be very useful.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arjan@21:1/5 to All on Fri May 27 00:45:36 2022
    Op vrijdag 27 mei 2022 om 08:43:26 UTC+2 schreef Sjouke Burry:
    On 27.05.22 8:02, Arjan wrote:
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    Try a human brain.
    Those things can be very useful.

    Of course.
    But:
    1: My brain does not have the knowledge yet and I miss the time to learn C++. 2: My project does not have the means to hire a person with a qualified brain.

    A.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Koenig@21:1/5 to Arjan on Fri May 27 09:52:16 2022
    Arjan <arjan.van.dijk@rivm.nl> schrieb:
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    My guess would be that it is almost impossible to do in a way
    that is possible except at a very low level that it would be almost
    iimpossible to maintain.

    Consider one C++ feature, multiple inheritance - Fortran does
    not have it (which is good), and there is no really clear way to
    model it, unless you construct your vtabs by hand.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From FortranFan@21:1/5 to Arjan on Fri May 27 10:10:25 2022
    On Friday, May 27, 2022 at 3:45:38 AM UTC-4, Arjan wrote:
    Op vrijdag 27 mei 2022 om 08:43:26 UTC+2 schreef Sjouke Burry:
    On 27.05.22 8:02, Arjan wrote:
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    Try a human brain.
    Those things can be very useful.
    Of course.
    But:
    1: My brain does not have the knowledge yet and I miss the time to learn C++.
    2: My project does not have the means to hire a person with a qualified brain.

    A.

    @Arjan,

    First, a question: why "2 FORTRAN"?! Staring with ISO IEC standard document for this programming revision published in 1991, it has been "Fortran" e.g., the so-called "Fortran 90" revision to refer to that 1991 publication.

    `FORTRAN` might come across as implying your interest in working with a prior version, say FORTRAN 77 and its nonstandard extensions. In year 2022, those who wish to work with such `FORTRAN` will be fewer in numbers!!

    Secondly, you may want to consider "crowdsourcing" such an effort instead of seeking a tool.

    For example, you can start a project on GitHub where you post the C++ code in question. Then you can request for help on this forum and also at the Fortran Discourse site (https://fortran-lang.discourse.group/) with translations to modern Fortran and
    chances are high several of the eager Fortran enthusiasts will chip away at the C++ code and assist with authoring modern Fortran incarnation of what this C++ code does.

    I suggest you give that a try, if you can.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Beliavsky@21:1/5 to Arjan on Fri May 27 10:25:59 2022
    On Friday, May 27, 2022 at 2:02:31 AM UTC-4, Arjan wrote:
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    No, but you can create C interfaces to your code and call them from Fortran. There are also tools such as SWIG https://github.com/swig-fortran and
    shroud https://github.com/LLNL/shroud to make it easier to call C++
    from Fortran.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Duffy@21:1/5 to Beliavsky on Sat May 28 01:36:21 2022
    Beliavsky <beliavsky@aol.com> wrote:
    Hi, is there a good tool to convert a C++ project to FORTRAN?

    The Rose Compiler knows Fortran and C++ and can translate backwards and forwards between languages. They don't give any examples specifically
    for C++ to Fortran, as it seems to be more a toolkit or framework
    for rolling your own:

    https://github.com/rose-compiler/rose/wiki/How-to-create-a-translator

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)