Compiling Perl to WebAssembly: A Herculean Task

2025-02-11
Compiling Perl to WebAssembly: A Herculean Task

Building a startup, the author faced a challenge: client-side file metadata extraction. ExifTool, while powerful, proved difficult to statically compile and deploy across OSes due to its Perl nature. Various approaches were attempted, including statically compiling Perl, finally leading to WebAssembly. The journey was fraught with challenges, battling Perl's build system, Emscripten, and WASI, even requiring Perl source code modifications. The author successfully built a self-contained WebAssembly Perl running ExifTool, but the process exposed insufficient exception handling support in WebAssembly runtimes.

Development