News for hackers. Stuff that matters.
Re:Seven years of Go by Manishearth on Thursday November 10, 2016 @02:31PM (#12923442)
That only works well if each "variant" holds the same kind of thing. If not, you have to store them one after the other (space wastage), or use interfaces to store them in the same place (tag isn't necessary anymore, extra boxing).

Rust enums (ADTs) aren't like Java enums where each variant contains the same kind of data.

Re:Seven years of Go by weberc2 on Thursday November 10, 2016 @03:06PM (#12923786)
I understand. I don't mind wasting a few bytes of stack for zero allocs.