Re: [w3ctag/design-reviews] WebAssembly Response API / Web Embedding (#167)

> It's an interesting point that CompileError doesn't tell you more about the failure. I suppose we could expose the byte offset that fails to validate, though that might open up a bunch of subtly around how precise it should be (i.e. the position of the opcode, or the immediate). Seems like something we could add if there's a use case?

I think one use case was mentioned in the long discussion above (although this would be a feature oriented to developers, but that's a given considering this is an API for compiling we are discussing) - if for some reason the service worker initiated stream rewrite has a bug and corrupts the code, knowing at least the offset might be useful for debugging. Another use case that comes to mind would be in the context of a building a new binary toolchain implementation.

I do understand you are not supposed to hand write wasm, but even the bare minimum of information that the implementation can provide in error interface could be useful compared than not having any information to work with at all. (Imagine invoking gas and it returns only 0 or 1 as the exit code. That doesn't sound too fun.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/167#issuecomment-303420844

Received on Tuesday, 23 May 2017 14:45:21 UTC