Let's build a Cloudflare Worker with WebAssembly and Haskell
Oct 6, 2020Cristhian Motoche

Summary
This post details the process of compiling Haskell code to WebAssembly using Asterius and deploying it as a Cloudflare Worker. It covers setting up the Asterius environment, writing a Haskell module with a foreign export for JavaScript, creating a JavaScript loader, compiling the code using `ahc-link`, and deploying the resulting WebAssembly module and JavaScript script to Cloudflare Workers via the API. It also demonstrates a more complex scenario using `ahc-cabal` to build a Cabal project and `ahc-dist` to compile it to WebAssembly for Workers.