News for hackers. Stuff that matters.
Re:Goenums: Type Safe Enum Generator for Go by bsaul on Saturday April 26, 2025 @06:45PM (#43807907)
"enums represent a different and incompatible concept in every language I know."

Enums has always felt very natural in every modern languages i've tried (swift and rust, for example), even with associated values. The underlying "sum type" concept also is very intuitive, and seems very complementary to structs for example.

Can you expand a bit on what you mean ?

Re:Goenums: Type Safe Enum Generator for Go by willtemperley on Saturday April 26, 2025 @08:39PM (#43808486)
This. I find Swift and Rust enums, which are indeed very similar, to be incredibly good at modelling the real world. For example the standard geospatial vector types which are heterogeneous and even recursive in the case of GeometryCollections can be modelled and operated upon very cleanly.