Andreas Rossberg
Andreas Rossberg
@alexcrichton, ah, but these are different classes of errors. Roughly, everything that corresponds to a legitimate Wasm error (e.g., trap or import mismatch) is reflected, because it is defined behaviour....
@sunfishcode, actually, the idea is to match Wasm behaviour precisely. Invalid uses are undefined in Wasm, and that carries over to the API. Unlike Wasm, we can't preclude invalid usage...
PS: I should also point out that checks like verifying the type of a value passed to global_set or table_set aren't even possible in general. With reference types, there won't...
@binji, that's a good question. Either we have to restrict the types of globals/tables that can be used in JS. Or JS-embedded engines have to make all their references self-describing...
@binji, good point about using an indirection, I'll edit the issue to mention it. Maybe that is indeed good enough, though it still would be nicer to have a "naturally...
Drive-by comment: Being useful is not a sufficient condition for supporting a feature, almost every imaginable feature is useful in certain situations, yet most are counter-productive in the grand scheme...
> Well, get requires key equality and hashing, so you need to have the non-stable HashMap_ version to project specific keys, and call those operations. Sure, but that makes HashMap...
Correct index-based access is a linear-time operation on Unicode strings, which immediately makes any looping based on it quadratic. It hence was a very deliberate decision to favour iterators and...
There isn't really a useful alternative to an iterators-based API. Because how would you compute an index? The only available way is by iterating over the text -- with an...
Btw, I believe that technically, the stable var `userS` doesn't need to be a `var`, it could just be a `let`, which would potentially be cleaner. Or was there some...