Hacker News new | ask | show | jobs
by peq 1864 days ago
Applications don't need generics, but libraries do.

The lack of generics is the reason for a lack of many useful libraries that I miss when writing applications in Go.

Things I missed lately: Sets, maps with arbitrary keys, lists, sorting, removing duplicates, priority queues, parser combinators, list transformation functions (map, filter), transactions.

Some of these exist for Go, but with awkward APIs.

1 comments

The Go idiom for set is a map with bool values and given that it'll just return false for keys that aren't initialized I really don't see what you're missing compared to having a dedicated type. I'm not sure what your complaint is about maps, lists, or sorting. There are some specialized types you might occasionally want and I miss FP constructs too, but I don't think these are really serious impediments to productivity.