openmymind.net · Jan 15, 2025
Peeking Behind Zig Interfaces by Creating a Dummy std.Random Implementation
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
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 your own, I recommend you read that post first. But I…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.