3 ms·
> The whole C interface is clunky because C does not support multiple return values. C has pointers which can easily enough be used as "out parameteters". In f
by masklinn 7y ago
> The whole C interface is clunky because C does not support multiple return values.
C has pointers which can easily enough be used as "out parameteters". In fact the C standard library regularly makes use of these. It's not amazing, but it works fine, and it's usually fairly easy to go back and forth e.g. expressing a stat(2) call is reasonably straightforward.
- jononor 7y agoHowever there is no way to know that programatically, and no standard way to annotate it either. So in FFI / language bindings context this is really tedious to work with.
- merb 7y agowell most of the time the return value is just an error integer, while the real return value is a pointer parameter.