|
|
|
|
|
by cgh
203 days ago
|
|
Essentially enough syntactic sugar so you could write eg the Allocator interface without manually specifying the vtable and the opaque pointer. But yeah, Go’s system is nice and simple. I am not sure, but I think the fact that Zig programs are a single compilation unit might have some bearing on the orphan rule. There is no concept of crates so “traits”/interfaces can be defined and implemented anywhere. |
|
Though, I am seeing your point on a simple interface system that would be enough to have something like the allocater interface, or the hash map interface.