Live data from Hacker News

Creating LFortran, an interactive Fortran compiler built on top of LLVM

lfortran.org

11–20 of 52 posts

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#11
post #9

Earlier quoted context omitted.

I'm going to take this in good faith and assume that you are thinking of old school FORTRAN77. Modern Fortran (90 and onwards) is a very different language in many ways whilst maintaining high backwards compatibility. You should check out modern versions of the language and code examples. Fortran is a language more suited for numerical computing than C++. Modern Fortran is simpler, more maintable and more easily opti…

Where does the Modern Fortran community congregate? Any websites or mailing lists?

Some of us are at /r/fortran

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#13
post #9

Earlier quoted context omitted.

I'm going to take this in good faith and assume that you are thinking of old school FORTRAN77. Modern Fortran (90 and onwards) is a very different language in many ways whilst maintaining high backwards compatibility. You should check out modern versions of the language and code examples. Fortran is a language more suited for numerical computing than C++. Modern Fortran is simpler, more maintable and more easily opti…

Where does the Modern Fortran community congregate? Any websites or mailing lists?

More so you’ll find its usage clustered in academia in areas you might expect, eg, numerical linear algebra, stuff involving solving PDEs.

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#14
post #9

Earlier quoted context omitted.

I'm going to take this in good faith and assume that you are thinking of old school FORTRAN77. Modern Fortran (90 and onwards) is a very different language in many ways whilst maintaining high backwards compatibility. You should check out modern versions of the language and code examples. Fortran is a language more suited for numerical computing than C++. Modern Fortran is simpler, more maintable and more easily opti…

Where does the Modern Fortran community congregate? Any websites or mailing lists?

Quite a healthy community on github producing nice modern Fortran code!

https://github.com/Fortran-FOSS-Programmers

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#15
post #3

There seems to be a missing question in the FAQ: Why is Fortran worth saving? What are the advantages of writing code in Fortran? Why not just allow the ports to C++ to happen? There might well be good answers to these; but it seems that if you want to make Fortran cool again, you have to provide a vision for what makes it special.

> What are the advantages of writing code in Fortran? Why not just allow the ports to C++ to happen?

A physicist or engineer, already being familiar with Matlab or Python, can pretty much pick up Fortran in about 2 days to 1 week, get to be productive, and the compiler will generally generate fast code. Try to teach C++ to a domain specialist, who doesn't have too much extra time to study programming language syntax and quirks, because their main motivation is working in their domain?

If the scientific code was in C++, some scientists would probably never become fluent enough, and the workflow would probably deviate towards a division where scientists prototype their ideas in Matlab or Python, and separate technical programmer personnel implement it in the production code. The turnaround time from ideas to seeing results would be days instead of hours.

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#16
post #3

There seems to be a missing question in the FAQ: Why is Fortran worth saving? What are the advantages of writing code in Fortran? Why not just allow the ports to C++ to happen? There might well be good answers to these; but it seems that if you want to make Fortran cool again, you have to provide a vision for what makes it special.

> Why not just allow the ports to C++ to happen?

I see two reasons why C++ is not a suitable language for domain specialists in numerical computing.

1. Programming in C++ requires a certain discipline to understand what is going on, for example to not accidentally make useless copies of huge arrays. In fortran you do not need to learn such a discipline because everything is explicit.

2. Fortran natively supports multidimensional numeric arrays. In C++, not really; you need to use "libraries" whose evolution is independent to that of the language and may become unsupported. A few years ago, everybody said to use "blitz", somewhat later it was "eigen", now it probably is something new. The C++ numerical code that you may write today will probably be obsolete in a few decades. Yet the fortran code will be alright. It is "eternal".

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#17
post #3

There seems to be a missing question in the FAQ: Why is Fortran worth saving? What are the advantages of writing code in Fortran? Why not just allow the ports to C++ to happen? There might well be good answers to these; but it seems that if you want to make Fortran cool again, you have to provide a vision for what makes it special.

A few years ago, Scott Meyers gave a keynote at the D Language Conference. It was titled "The Last Thing D Needs". The answer given at the end was, "Someone like me". It's a bad sign if your language is so complex that it needs someone like him to write books on how to not massively screw things up.

Fortran does not need Scott Meyers. And that's a good thing, because those who program in Fortran are typically not full-time software developers, they are individuals with other things to do that would not ever invest the time to write "proper" C++.

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#18

Not sure what they mean by lack of support for GPU - Intel Fortan has this and I am sure others do.

I am one of the LFortran authors.

Can you please point me to some documentation or examples where Intel Fortran is used to offload to, say, NVIDIA GPUs? I don't think it supports it yet.

PGI and IBM support CUDA Fortran, other compilers don't. PGI/Flang has an experimental support for offloading "do concurrent". Some compilers also support the openmp/openacc pragmas and GPU offloading. One can also call CUDA C from any Fortran compiler via iso_c_binding. None of this is ideal.

I think it's still a research problem how to best integrate GPU support in the language itself. CUDA Fortran is nice --- one thing we want to do down the road is to implement CUDA Fortran and to allow LFortran to transform code it understands into a Fortran dialect that all Fortran compilers can compile, so that one can use any Fortran compiler and still use CUDA Fortran.

The other path is to parallelize "do concurrent", but part of this is also means to extend Fortran to allow to specify the array layout, as Kokkos (https://github.com/kokkos/kokkos) allows.

That is one of the biggest problem with Fortran: people want to be assured that their code will run on modern hardware. When using, e.g., C++ and Kokkos, then there is some assurance that the code will run.

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#19
post #12

This post talks a lot about creating a community. Are they doing that anywhere in particular?

I am one of LFortran authors. We just open sourced it recently. Do you have any recommendations if we should create a mailinglist, or rather use something like Discourse? Or both.

Right now if you have any questions, you can open an issue at our GitLab repository:

https://gitlab.com/lfortran/lfortran

Re: Creating LFortran, an interactive Fortran compiler built on top of LLVM

#20
post #3

There seems to be a missing question in the FAQ: Why is Fortran worth saving? What are the advantages of writing code in Fortran? Why not just allow the ports to C++ to happen? There might well be good answers to these; but it seems that if you want to make Fortran cool again, you have to provide a vision for what makes it special.

One of LFortran authors here. You have a very good point. We are going to publish a new blog post answering this exact question.

In the meantime, others in this thread pretty much hit all the main points already why Fortran as a language is still a very good choice for numerical computing. It's the tooling that must improve.

Post reply on HN