LFortran compiles fpm

35 points14 comments3 days ago
auvi

I am curious to know why there are two Fortrans (i.e. LFortran and LLVM Flang) both targeting the LLVM backend?

show comments
wrs

It's such an odd little subcultural quirk that Fortran (really HPC) people call programs and libraries "codes". Most software folks refer to "code", as if it was a substance like sand or water, and use other words for specific units of "code" (programs, libraries, modules).

show comments
stackghost

I've always had a soft spot for Fortran, even though I rarely use it any more.

When I was in undergrad, so sometime around 2006 or so, I read somewhere that Fortran was actually faster than C in some cases, due I believe to the compiler and certain choices it makes regarding aliasing arrays and whatnot.

I am an aerospace engineer and avid flight simmer, mostly WWII combat sims, and a huge part of the hobby involves arguing with other people about WWII piston aircraft and their performance. Pages upon pages of forum threads replete with PDFs of historical documents in German, Russian, etc. In order to win arguments more effectively, I decided to write a parametric "flight sim" that would accept a set of maneuvers as an input (e.g. "start at 10000m, dive until speed reaches X km/h indicated, zoom climb back up" or "turn in a circle at Y km/h indicated") so that I had something to compare the in-game results and historical data with.

I decided to write the whole thing in Fortran 2003 (the 2008 revision was still a draft, as I recall), because fast.

I bought a copy of Stanley Hooker's book "The Performance of a Supercharged Aero Engine" from the Rolls-Royce heritage press, implemented the method therein. Implemented a numerical vortex panel method for the lifting surfaces, the whole shebang. It was actually a really fun project and it worked pretty well. Fortran is a neat, quaint language and I look back on that project fondly but ultimately I don't miss Fortran. The syntax is needlessly verbose. I/O is a chore. String manipulation is a pain. If you ask me, C++ (despite its many flaws) is superior in every way.

show comments