(no title)
andolanra | 3 years ago
We can also do better in those other languages, too. For example, in Rust, I can use a crate like `bitfield` which gives me a macro with which I can write
bitfield! {
pub struct Color(u32);
red, set_red: 0;
green, set_green: 1;
blue, set_blue: 2;
alpha, set_alpha: 3;
}
Don't get me wrong: it's cool that functionality like this is built-in in Zig, since having to rely on third-party functionality for something like this is not always what you want. But Zig is not, as this article implies, uniquely capable of expressing this kind of thing.
zppln|3 years ago
jeroenhd|3 years ago
speed_spread|3 years ago
That's the luxury of a standard build system: essential but rarely used features can be left out of the core language / lib because adding them back in is just a crate import away.
masklinn|3 years ago
aconbere|3 years ago
Many years ago I wrote a rust program to decode some game save data and it looks like what you’d expect.
https://github.com/aconbere/monster-hunter/blob/master/src/o...
unknown|3 years ago
[deleted]