LLVM Flang + Emscripten Compiler

Considering this announcement

has there been anyone trying to get modern Fortran code to compile to webassembly via Emscripten?
I know of a few prior experiments, but integration into LLVM should make this much easier if the about page for Emscripten is accurate.

Compile C and C++ code, or any other language that uses LLVM, into WebAssembly, and run it on the Web, Node.js, or other wasm runtimes.

I’d like to expand upon a few R simulations I did awhile back on the repeat sampling behavior of p-values, make it a single page application, and expand on their relationship to Bayesian methods. I’d prefer to do this in Fortran + Typescript, but might have to use a c/c++ library for the numerical aspects.

Yes, we got simple examples working with LFortran thanks to Carlos Une:

If anyone is interested in helping us expand this and make this very usable, please let us know.


I’ll be playing around with this! I shouldn’t need to do anything terribly intensive, just converting from p (on a 0-1 scale) to probits (-\infty < Z <+\infty). I’m almost positive there are Fortran intrinsic functions that already compute these things.

1 Like

If you need any intrinsic that is not yet implemented in LFortran, please report a bug and we’ll fix it.