What is the exact difference between LLVM Flang and LFortran?

I don’t think there is a connection between the language a compiler is written in and how fast the resulting programs are. If a Fortran program does not follow the syntax rules of C++ it is not a C++ program, regardless of the compiler implementation language.

I have thought about whether Fortran is a subset of C (or the reverse), but the idea has to do with Fortran/C interoperability. If any standard-conforming C function can be called from a Fortran program, without a speed penalty, and if all platforms with Fortran compilers also have C compilers, maybe one could say that Fortran contains a C subset with distinct rules.

2 Likes

Five parts of a compiler are Lexical Analysis, Parsing, Semantic Analysis, Optimization, and Code Generation. These slides show a little example of each related to English. http://web.stanford.edu/class/cs143/lectures/lecture01.pdf

3 Likes