Here’s an example of a function where they’re already being used: std.log.logEnabled()
While this is nothing that couldn’t have been implemented in userland with some imaginative use of switch(@typeInfo(@TypeOf(arg))), it’s exciting to see new convenience builtins, which will surely be cited in the release notes as “part of the ongoing effort to improve ergonomics for game development”.
I bet a lot more people will be more willing to play around with packed structs and enums with these new builtins in place, particularly stuff like non-exhaustive enums as indices for concepts like Data-Oriented Design.
These builtins are meant to replace the now-deprecated @intFromEnum and @enumFromInt builtins.
Fantastic that the behavior of these builtins can be generalized to packed structs/bitfields. And even without these new features, @backingInt would still be a better name than @intFromEnum.
I had a look but the documentation is very scarce, and it looks more like a big framework targeting many platforms - not ideal for a learning experiment. Also I didn’t find anything targeting UNO but maybe I simply missed it.
Can’t help with Arduino as I’m working with an ARM chip, which just works with Zig 0.16.0. I’ve got this library code published, but it’s very incomplete and there’s no entry point as the only consumer I’ve got at the moment is specific to proprietary hardware under an NDA.