5 ms·
Sets don't need to be native in languages that are both fast and have a proper type system. For example, rust and OCaml have a standard set in their stdlib, but
by c-cube 9y ago
Sets don't need to be native in languages that are both fast and have a proper type system. For example, rust and OCaml have a standard set in their stdlib, but it's not builtin.
Of course, go lacking generics makes it impossible to implement a decent set type in it.
- xapata 9y agoSet literals are nifty. If they're in stdlib rather than built-in, they can't be literal syntax.
- ZenoArrow 9y agoI wouldn't hold up OCaml as an example of how to structure your standard library, the lack of standardisation in its standard library is one of the remaining weak points of an otherwise excellent language. For those that don't know, there are multiple standard libraries for OCaml, each with different trade-offs, leading to unnecessary fragmentation.
- c-cube 9y agoAgreed, some things are still missing (in particular my pet peeve, iterators; also unicode strings). But for what it provides, OCaml's stdlib is reasonably well designed and performs well.