AssemblyScript / assemblyscript

A TypeScript-like language for WebAssembly.
https://www.assemblyscript.org
Apache License 2.0
16.6k stars 650 forks source link

asc decompile wasm (or wat) to AssemblyScript #2844

Open ArcaneEngineer opened 2 months ago

ArcaneEngineer commented 2 months ago

Feature suggestion

Not sure if this is possible...

My workflow involves taking sources from different languages, transpiling these to WAT (via compilation to WASM) and looking at the generated WAT source and making further reductions / changes. So these WASMs which I get from compiling in other languages, I would like to get into AssemblyScript, from whence I can compile and produce build artifacts.

(It is too easy to overwrite WAT files by mistake as they are generated all the time... and besides, it's not the most human-readable format. I'd rather have my sources as AssemblyScript.)

WIP for this? It makes sense (to me) that since AssemblyScript is closely associated with WebAssembly, there would be a tool like this already. But I can't find anything. I imagine the implementation would be quite similar to the existing wasm2c in WABT.

Maybe it's something that could help AssemblyScript gain further traction.