News for hackers. Stuff that matters.
Re:Show HN: Functional programming for modern Fortran by greglindahl on Wednesday November 23, 2016 @06:34PM (#13026690)
Fortran has had lots of implicit loops to optimize since 1990, so, as long as the compiler can see to the bottom of the call (via cross-module inlining), it will do a great job.

Interestingly, Fred Chow and the SGI compiler/Open64/Path64 etc. optimizes implicit loops by expanding them into explicit ones, and then making sure that the regular optimizer does a great job on that.

Re:Show HN: Functional programming for modern Fortran by jabl on Thursday November 24, 2016 @02:43AM (#13028892)
> Interestingly, Fred Chow and the SGI compiler/Open64/Path64 etc. optimizes implicit loops by expanding them into explicit ones, and then making sure that the regular optimizer does a great job on that.

So does GFortran, FWIW. That being said, there is a lot of work to that is done before this lowering pass (as I'm sure you know, but for other readers who might not be as familiar with Fortran and compiler internals). In particular, the Fortran array expression semantics are that the RHS is evaluated before assigning to the LHS. So a simplistic approach would require allocating a temporary array every time. So there needs to be quite a lot of logic to handle various special cases in order to avoid the temporary arrays.