News for hackers. Stuff that matters.
Re:Using enums to represent state in Rust by duped on Friday September 22, 2023 @04:23PM (#37617278)
Typescript and Dart have union types that work this way.
Re:Using enums to represent state in Rust by Expurple on Friday September 22, 2023 @11:48PM (#37620444)
Also, Python with type annotations. But it's not a very fair comparison, since objects in Python/TS are all heap-allocated, introspectable and contain rutnime type information. Rust doesn't have any of that by default