StarGate01 / Full-Stack-Fortran

Fortran to WebAssembly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Docker Pulls

Full-Stack-Fortran

A toolchain to compile Fortran to Webassembly, and a few projects using it.

Blog post: https://chrz.de/2020/04/21/fortran-in-the-browser/

Docker image: https://hub.docker.com/r/stargate01/f90wasm

2024 Update Note

This project was originally published in 2020. Today, in 2024, the FORTRAN compiler landscape has changed quite a bit – while FORTRAN still does not enjoy first-class WebAssembly support in the LLVM toolchain, it is now possible to set up a much more sane toolchain by applying a few patches to LLVM.

Dr George W Stagg has published an excellent writeup of his LLVM modifications, and the application of the resulting toolchain to several real-world projects. Specifically, the WebR project and a cool BLAS-based in-browser digit classifier.

Usage

Run ./f90wasm/build.sh to build the docker image locally. A pre-compiled image is available on the Docker Hub.

Run ./test/test.sh to compile the test application, and host it on http://localhost:8080 . Use ./test/clean.sh to remove compiled test binaries.

Thanks to

TLDR

Toolchain Flowchart

About

Fortran to WebAssembly

License:Mozilla Public License 2.0


Languages

Language:Fortran 96.4%Language:Makefile 1.4%Language:Dockerfile 1.2%Language:HTML 0.5%Language:Shell 0.5%Language:C 0.1%