Hacker News new | ask | show | jobs
by wch 811 days ago
A little context: this dive into Fortran is part of the excellent work George has been doing on WebR, to get R running in the browser. The R sources contain a fair bit of Fortran code, and I believe WebR originally used f2c to compile the Fortran to C first, before compiling that to wasm.

With the patches to LLVM Flang, WebR can be built with a real Fortran compiler.

I think George didn't want to say it directly in the blog post, but he has said that he's hoping that Flang would take his patches or implement better ones. That would be a win-win -- these patches wouldn't need to be maintained separately, and since unmodified Flang would be able to compile to wasm, it would benefit other projects out there that use Fortran.

https://docs.r-wasm.org/webr/latest/

2 comments

Pull requests are always welcome (https://github.com/llvm/llvm-project), and one can contact the general LLVM Fortran development community (https://discourse.llvm.org/c/subprojects/flang/33) for help. I am focused on things needed to complete development for Nvidia's Fortran product and don't have any time left for things like this, myself.
Source to source, F77 to JavaScript is already pretty good but WASM is better.