Hacker News new | past | comments | ask | show | jobs | submit login

I don't get it, why wouldn't you just store tag + count instead? Am I missing something?





The article is eliding the enum's payload. A more realistic example would, I think, have each leg of the enum contain a distinct type of struct (or some other data) in addition to the tag itself, and then have each EoA factored into its own internal SoA.

These are enums as Rust coined the term, meaning sum types, not as C did, meaning a subrange of ints with magic names. The Spam and Eggs types contain data

"enums" here are not like C enums, but rather tagged unions as in Rust where the individual items can store data rather than just being empty tags



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: