logoalt Hacker News

jedisct1today at 8:24 AM1 replyview on HN

Compiling WASM to C is a really good option: https://00f.net/2023/12/11/webassembly-compilation-to-c/


Replies

ncrucestoday at 9:24 AM

Shameless plug… compiling it to Go is a great option too: https://github.com/ncruces/wasm2go

I've used it to translate SQLite (with a few extensions) and, that I know of, it's been used (to varying degrees of success) to translate the MARISA trie library (C++), libghostty (Zig), zlib, Perl, and QuickJS.

More on-topic, I use a mix of an unevaluated expression stack and a stack-to-locals approach to translate Wasm.