http://users.fred.net/tds/lab/p2c/
Also the languages are similar enough that a programmer with knowledge of both could translate it manually without too much difficulty.
But there also is a Pascal to WASM compiler out there, which was written specifically for TeX:
https://github.com/kisonecat/web2js
TeX itself is only about 500kb of wasm, uncompressed, but the memory images with LaTeX loaded are quite a bit larger.
http://users.fred.net/tds/lab/p2c/
Also the languages are similar enough that a programmer with knowledge of both could translate it manually without too much difficulty.