4 ms·
Is it just me or does it seem nonsensical that TH splices are compiled to WASM then executed with a WASM interpreter rather than just being interpreted natively
by Laaas 4y ago
Is it just me or does it seem nonsensical that TH splices are compiled to WASM then executed with a WASM interpreter rather than just being interpreted natively by GHC like done with GHCi? Would also fix the weird situation with running git inside splices not working.
- whateveracct 4y agoIn general, you must run TH on the target platform for it to be correct. Otherwise, you may generate code that only works on your host (it isn't impossible for TH output to be platform-specific especially since it can do IO)
- marcosdumay 4y agoWell, now the standard can change so it always runs as WASM, and completely fix the issue.
- whateveracct 4y agoBut sometimes it might want to run on the host still (e.g. there are tools out there that generate C bindings that use platform-specific things like sizes and alignments) If we had pure TH, then at least that could run in wasm. That would be nice. But idk - I cross-compile Haskell heavily in my free time and I don't mind the external interpreter stuff.
- marcosdumay 4y ago> If we had pure TH, then at least that could run in wasm. That would be nice. IMO, ideally, pure TH wold be completely platform independent. But running in a standardized VM is a close second place. Anyway, I never realized those bidings were created with TH.
- whateveracct 4y ago`inline-c` is the main example I can think of
- vmchale 4y agoYes it's quite an unfortunate situation. Edward Z Yang has a canonical post on this: http://blog.ezyang.com/2016/07/what-template-haskell-gets-wrong-and-racket-gets-right/ http://blog.ezyang.com/2016/07/what-template-haskell-gets-wr...