Re:Lfortran: Modern interactive LLVM-based Fortran compiler
by queuebert on Monday August 28, 2023 @02:32PM
(#37298548)
This is the correct answer. They almost entirely compile to the same machine code for the computationally intensive parts. (Even Julia does that these days.) But the limitations of Fortran prevent a lot of difficult-to-debug C bugs, while not affecting typical scientific and numerical capability.
Re:Lfortran: Modern interactive LLVM-based Fortran compiler
by dagss on Tuesday August 29, 2023 @12:29AM
(#37303577)
C can be as good as Fortran if make sure to declare pointers "restrict". That is a C feature added in C99 though. For Fortran it has always been the default.
For a long time Fortran was actually unbeatable and C did not suffice to specify all possible uses of assembly...
The nice think about Fortran it that is does the sensible thing by default for the type of scientific computing codes that are inside it’s wheelhouse (the trivial example, it assumes arguments don’t alias by default).
C can beat anything, assuming unlimited effort. Fortran is nice for scientists who want to write pretty good code. Or grad students who are working on dissertations in something other than hand-tuning kernels.