Hacker News new | ask | show | jobs
by aartur 5014 days ago
I meant that if they use generics in some built-in classes, they should also give that possibility to users. If they cannot give it to users, they shouldn't use it in built-in classes. It feels like they think users are too dumb to implement their own, so they give some created by them.
4 comments

Maybe they are afraid of introducing some features they would later regret. This is not a hobby project of some lone hacker, it's meant to compile Google's infrastructure.

I really don't see why user code has to have the same capabilities as the runtime. It looks more like a philosophical request than a practical one.

I believe you are letting your raw feelings get in the way of making technical assessments and decisions.
Should all languages also allow users to define flow control structures?

Yes, some languages do this, but there is (as almost always) a trade of between simplicity and flexibility.

I think Go strikes a very nice spot there.

In go the built in datastructures are very carefully selected, and are extremely useful, while when you need to build your own datastructures is both simple and powerful (you have direct control over memory layout), you just can't build magically generic datastructures, but that always comes at a cost, and Go's interfaces also provides ways to write generic code that are quite powerful.

Kind of like arrays in C or in pre generics Java and C#. Definitely not ideal but not that unusual either.