Hacker News new | ask | show | jobs
by yodelshady 1925 days ago
Fortran's the only obstacle to purchasing M1 for me currently.

A while ago I compared the execution time for some simple matrix arithmetic in rust, fortran (2003 I think), and python/numpy. (as an aside: as far as science is concerned, python without numpy doesn't exist.) Execution times were fairly similar.

What I didn't mention was the pretty-much-optimal fortran and python solutions took maybe a minute to code.

The optimal Rust solution took over a day.

I'll also note intent(in), intent(out) fulfil similar uses to '&' and '&mut'.

3 comments

LFortran is not ready yet for production usage, but I've been developing it on M1 Macs, everything works (both compiling of LFortran itself, as well as LFortran compiling other codes and interactive usage in Jupyter). It compiles really fast and I really enjoy the experience of M1.
Very interested in LFortran, are there any benchmarks how it compares with respect to performance to GFortran or Intel Fortran?
There is speed of compilation (I did some very preliminary benchmarks and I think it will be very good) and there is speed of the generated code, there currently we just use stock LLVM. But down the road we will have special optimizations on top, just like Intel Fortran is doing. Some of the things I personally would like to have a close look on is array operations, where I've heard from many users that they are slower than explicit loops. And function inlining and other such operations.

We want to have a dedicated repository for benchmarking compilers:

https://github.com/fortran-lang/benchmarks/issues/2

Why do you think the Rust version was so much slower to produce?
Rosetta 2 provides really good performance so you can just run your regular x86 toolchain and executables on it until there’s native support.