you have probably heard that webassembly supports garbage collection. are you looking for an ahead-of-time compiler for wasm with gc? as it happens, i have written a little monograph on the topic
wingolog.org/archives/202...ahead-of-time wasm gc in wastrel — wingolog
wingolog: article: ahead-of-time wasm gc in wastrel