Dave Bakker

Results 154 comments of Dave Bakker

`INVALID_STATE` is already mapped: ```c case NETWORK_ERROR_CODE_INVALID_STATE: case NETWORK_ERROR_CODE_NOT_IN_PROGRESS: abort(); // If our internal state checks are working right, these errors should never show up. break; ``` Given that wasi-libc...

I think wasi-libc can implement it like: ```rs return if state == TCP_SOCKET_STATE_CONNECTED && input_pollable.ready() { 8192 } else { 0 }; ``` Some additional info: https://github.com/WebAssembly/wasi-sockets/issues/17

Is it possible to generalize the feature for any dynamically sized data structure? As opposed to only allowing it in places explicitly annotated as such (using `list`). If I understand...

> reliably achieving the caller-supplied-buffer optimization Your proposal definitely has a leg up on my suggestion in that regard. At the same time, I wonder how much this matters in...

Hmm, ok. Fair points. Different question then: is there a reason why the list length needs to be encoded in the WIT list type? From what you've described so far,...

The exact same validation can still be done if the length was passed at runtime, right? The only change is that in that case there is effectively an implicit `length`...

I've given it some time, but I'm still not quite happy with what has been proposed so far (including my own proposals). Overall, I can't help feeling uneasy about the...

> Thinking more about the details of how a buffer might work: > > - At least for starters, I think we'd want to limit T to just the scalar...

> The basic idea is that: in any place where we would have to call cabi_realloc to get an i32 pointer to copy into, the CABI instead inserts, in that...

Hmm, fair point. If the "number of bytes read" outparam is the only difference between readable buffers and regular lists, I wonder whether it then is worth the effort of...