C to Fortran transpiler

I used Codex and Claude to write in Python a transpiler from C to modern Fortran. It correctly translates a handful of numerical C codes at the repo, and I will test it on larger C code bases.

2 Likes

Now you should translate SciPy back to Fortran. :slight_smile:

3 Likes

ChatGPT says the following SciPy algorithms ought to be implemented in Fortran:

  1. AAA β€” compact, distinctive, numerically interesting, and apparently a genuine Fortran gap.
  2. LGMRES and GCROT(m,k) β€” immediately useful in large scientific programs.
  3. funm_multiply_krylov β€” high-value matrix-free numerical linear algebra.
  4. LOBPCG β€” substantial demand and a natural fit for Fortran HPC applications.
  5. COBYQA β€” very valuable, but considerably harder to implement and validate.
  6. SHGO β€” distinctive, though its data-structure-heavy implementation is less naturally Fortran-oriented.
  7. Complete QMC suite β€” broad utility, but a larger packaging and API project.
1 Like

Isn’t COBYQA one of the optimisation algorithms by Mike Powell? In that case the original will have been written in FORTRAN 77.

Yes, and I think it is in

1 Like

If I’m not mistaken, COBYQA is not in PRIMA. The acronyms are very similar but they should not be confused together.

Oh, indeed: COBYLA versus COBYQA!