HackerTrans
TopNewTrendsCommentsPastAskShowJobs

leagreeer

no profile record

comments

leagreeer
·12 months ago·discuss
In every different zig project you have to read the source code to see how their specific ad-hoc interface scheme works. Case in point - this article uses a method `pub fn implBy(impl_obj: anytype)` to connect instances to a vtable. The new zig writer uses a `.interface` data member scheme: https://www.openmymind.net/Zigs-New-Writer/ in addition to understanding when and when not to use it.
leagreeer
·12 months ago·discuss
> Do all code bases use the same pattern?

Unfortunately no - it's a complete free for all - which is the problem. Conventions are great to a point but language enforced constructs are better.
leagreeer
·12 months ago·discuss
Agreed that native interface support is table stakes for any language now. It would avoid so much boilerplate - nevermind the time wasted examining the code to see what kind of ad-hoc interface any given piece of code is using - and how to retrieve the ridiculous zig vtable data member for each pseudo class instance. It just amounts to useless noise in the code, rather than succinctly stating the intent.