Live data from Hacker News

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

lfortran.org

21–30 of 52 posts

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

#21
post #9

Earlier quoted context omitted.

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

That's a bit more energy than I would use for describing the activity in the group :)

Last time I think I saw any action was the heated debate about goto:s in the style guide ;)

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

#22
post #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 a…

Ah I sit corrected I though Intel would it looks like they have their own ideas in that area.

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

#23
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 mult…

Eigen is still the best-in-class C++ library for linear algebra as far as I know. It's been around for a while, is still actively developed, and I don't think there's a risk of it becoming obsolete anytime soon.

That being said, the learning curve for someone not familiar with C++ to write code using Eigen is much higher than writing the same code in Fortran. If you're not already a C++ programmer, you just want to do some math, and Numpy/Matlab are too slow or constrained, then Fortran is a solid choice.

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

#24
This looks very interesting! I hope that maybe this project can include a “refactoring parser”, that is, for each token in the parse tree, store where in the source code file that token originated from. Also, white space and comments have would have to be included, such that the round trip (source file -> AST -> source file) is possible without loss. I’ve long wanted to write some refactoring tools for modern Fortran, but not having such a parser is a big blocker—there’s only so much you can do with regexes.

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

#25
post #24

This looks very interesting! I hope that maybe this project can include a “refactoring parser”, that is, for each token in the parse tree, store where in the source code file that token originated from. Also, white space and comments have would have to be included, such that the round trip (source file -> AST -> source file) is possible without loss. I’ve long wanted to write some refactoring tools for modern Fortran…

Wouldn't writing an Antlr grammar handle this?

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

#27

Question: What is a good Fortran compiler/implementation these days? I know they have Intel and IBM and SimplyFortran as commercial software. GFortran works via GCC. Is it as good? Has anyone on here used this LFortran.

Everybody I know in public science (physics) uses gfortran, works just fine.

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

#28
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.

Because modern Fortran is an extremely fast, vectorized and highly optimized numerical computing language. Like MATLAB, but much faster.

C++ is a messy, unsafe, and not particularly elegant systems programming language, which can be used for numerical computing, but it is not a good idea.

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

#29

Question: What is a good Fortran compiler/implementation these days? I know they have Intel and IBM and SimplyFortran as commercial software. GFortran works via GCC. Is it as good? Has anyone on here used this LFortran.

Gfortran is very nice, but I recommend a recent version (at least ver >= 7) rather than old versions (e.g. ver 4.4, which may still be the default on CentOS 6 etc). For performance, I guess Intel fortran is probably better (but also depends on calculations).

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

#30
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 mult…

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

Have you heard of MPI or even OpenMP ?. They can be used to accelerate fast computation in C++ or even work on domain-specified parallel execution.

Post reply on HN