Peeking Behind Zig Interfaces by Creating a Dummy std.Random Implementation

from blog openmymind.net, | ↗ original
Zig doesn't have an interface keyword or some simple way to create interfaces. Nonetheless, types like std.mem.Allocator and std.Random are often cited as examples that, with a bit of elbow grease, Zig offers every thing needed to create them. We've looked at Zig Interfaces in the past. If you want to understand how they work and how to write...