3 ms·
The language semantics matter greatly. GHC with `-fllvm` is not going make Haskell any easier to compile just because it's targeting LLVM. Fortran is (relative
by cscheid 3y ago
The language semantics matter greatly.
GHC with `-fllvm` is not going make Haskell any easier to compile just because it's targeting LLVM. Fortran is (relatively!) easy to make fast because the language semantics allow it to. Lack of pointer aliasing is one of the canonical examples; C's pointer aliasing makes systems programming easier, but high-performance code harder.
- pklausler 3y agoPointers in Fortran can alias with each other and with valid pointer targets. What makes Fortran potentially easier to optimize are its rules against dummy argument aliasing in most (but not all) cases. (See https://github.com/llvm/llvm-project/blob/main/flang/docs/Aliasing.md https://github.com/llvm/llvm-project/blob/main/flang/docs/Al... for the full story.)
- cscheid 3y ago> dummy argument aliasing Thanks for the precise Fortran terminology; that's what I meant to say in my head but you're correct. From the linked website for everyone else: "Fortran famously passes actual arguments by reference, and forbids callers from associating multiple arguments on a call to conflicting storage when doing so would cause the called subprogram to write to a bit of that storage by means of one dummy argument and read or write that same bit by means of another."