News for hackers. Stuff that matters.
Re:When Zig is safer and faster than Rust by tialaramex on Tuesday March 07, 2023 @08:17PM (#35063895)
I think you're right, although mentioning a macro does suggest another option here, you could write a macro which transforms [{foo1, "bar1", baz1}, {foo2, "bar2", baz2}] into the named structure version.

Since it's a macro there's no impact on runtime performance, but on the other hand it's more work to debug it. Learning declarative macros in Rust is much nicer and safer than learning C macros, but nowhere near as powerful as Rust's horribly unsafe proc macros.

There are no comments on this comment yet.