top | item 43280985

LFortran compiles PRIMA

77 points| genphy1976 | 1 year ago |lfortran.org

26 comments

order

pjmlp|11 months ago

Nice milestone.

Modern Fortran is no longer the FORTRAN from punch cards, having this compiler push maybe will help folks to write directly blazing performance Fortran code, instead of numerical code in Python.

yjftsjthsd-h|11 months ago

I was given to believe that a lot of numerical code in python is fortran with a little bit of wrapper?

andsoitis|11 months ago

LFortran is an alpha-stage modern, interactive LLVM-based Fortran compiler.

froh|11 months ago

thanks you've saved me looking it up myself

quanto|11 months ago

> It utilizes a range of Modern Fortran features, including extensive use of optional variables, function pointer passing, and a randomized test driver, among others. Successfully compiling PRIMA requires a compiler with a robust and mature backend, as well as well-developed intermediate passes and a capable parser.

I am not getting a full picture here. What's challenging about PRIMA code base? Does it use some advanced features that are difficult for a compiler to support? Are the mentioned features in the 2008 standard?

What's actually impressive is that LFortran in alpha stage is only 2x slower than GFortran, which goes back decades.

certik|11 months ago

It was a lot of corner cases that we had to get right, it's the most advanced code that LFortran can compile. I think none of the features individually is difficult to support, but there were a lot of them.

actinium226|11 months ago

Congrats to Ondřej Čertík and the team working on LFortran, this is a big milestone!

genewitch|11 months ago

I'll have to benchmark a library-less Matmul with LFortran, to compare against flang, C, and python versions.

Roughly: 8, 12, 18 units of time, respectively. Python only being twice as slow for the simplest matmul - how much of that is merely the interpreter startup time?

erwiue|11 months ago

[deleted]

rewqa|11 months ago

[deleted]