Maybe experiment with Go -> WASM -> C -> binary build pipeline
Suggested in Lisbon as a potential strategy to minimize PT size, on the assumption that clang or gcc may be able to create smaller binaries than the Go compiler itself. One side-effect of this is that we may be able support PTs on systems which do not support Go such as Windows 7. This isn't specifically needed for Tor Browser since we have a hard requirement on Win 10+ after ESR-128, but may help downstream projects.
The proposed pipeline would go something like:
- PT source to .wasm using GOARCH=wasm
- .wasm bin to C using wasm2c
- compile C source to platform native bins using standard C toolchains
/cc @JeremyRand /cc @cohosh