Sure there is! In Zig you can declare identifiers that contain character sequences that would otherwise be invalid if you wrap the names in @"...": Documentation - The Zig Programming Language
This works for struct field names too, and you can access those fields using the same @"..." syntax, or the @field() builtin:
$ cat field.zig
const std = @import("std");
const FancyName = struct {
@"field$name": []const u8,
};
pub fn main() void {
const fns: FancyName = .{ .@"field$name" = "test" };
// both of these do the same thing
std.debug.print("using @\"...\": {s}\n", .{fns.@"field$name"});
std.debug.print("using @field(): {s}\n", .{@field(fns, "field$name")});
}
$ zig build-exe field.zig && ./field
using @"...": test
using @field(): test
So, for your example above, you can use this code: