4 ms·
> somewhat error prone do you have any evidence for this? what is the error you're proposing here?
by throwawaymaths 1y ago
> somewhat error prone
do you have any evidence for this? what is the error you're proposing here?
- lenkite 1y agoI meant human error - easy to mess up when coding this boilerplate, esp if there are more number of methods. Sure some 'perfect' programmers will always get this right but the vast number of us regulars will not. Also, it is not straightforward to discover these interface types in a code base. I like Zig and eagerly await 1.0, just wish it was not quite so bare-bones.
- throwawaymaths 1y agowell if you mess up most basic things won't the compiler catch you? i was wondering what sorts of logical errors you were expecting.
- lenkite 1y agoNo, I don't think the compiler will catch all errors. Wrong type specified in adapter, for example (typical copy-paste mistake). Signature mismatches between anyopaque and MyType, forgetting to assign a function in the v-table, etc
- throwawaymaths 1y agoi think at least forgetting to assign a function is not possible? the compiler will catch that.
- lenkite 1y agoYes, forgetting to assign is caught by the Zig compiler, my bad. (brainfart and confused with C++ there). What the compiler doesn't catch is signature mismatches such as anyopaque to *SomeType or incorrect adapters.