For anyone interested, here's how easy it is to use s7 (which is implemented as one big ANSI C file) in WASM. https://github.com/iainctduncan/s7-wasm
And a more comprehensive example: https://github.com/actondev/s7-playground