Closed
Description
Many applications need stack traces for proper logging and debugging support, but due to WebAssembly's Harvard architecture and structured control flow, it is impossible to implement stack traces in WebAssembly without help from the embedder.
Emscripten has a bespoke stack trace API that parses and caches JS stack traces, but that is not usable outside a JS embedding, so it would make sense to standardize a WASI API for stack traces that all embedders can implement. Stack traces give WebAssembly modules introspection capabilities they would not otherwise have, so the API should require a capability.