Using Fortran on Cloudflare Workers
May 7, 2024John Graham-Cumming, Sven Sauleau

Summary
This post details the process of compiling and running Fortran code on Cloudflare Workers by leveraging WebAssembly. It introduces the 'Fortiche' toolchain, which uses Flang and Emscripten to compile Fortran to WebAssembly. The post provides a concrete example of a Fortran subroutine for addition, demonstrating how to export functions to JavaScript and manage memory allocation and deallocation within the Worker. It also showcases a more complex example of a handwritten digit classifier using BLAS and LAPACK libraries, highlighting the ability to run scientific workloads at the edge.