Comment

Comment by p0nce

More FUD and rationalizations from GhettoLang!

> do you want slow programmers, slow compilers and bloated binaries, or slow execution times?

Easy I want "slow compilers and bloated binaries".

In my experience "bloated binaries" in the real world aren't as bad as one would think, since instruction cache problems only appear when your working set is huge, not when your total binary size is huge.

Equating big binaries with slowness is simply misleading. What's next, increased download times?

> The generic structures are less useful than a concrete one.

Without generics you can't separate algorithms from data structures so everything is much less useful. If the members names are worse, sub-type then rename symbols.

> Generic structures can be less optimized than a concrete solution.

False. That "concrete solution" not only has to be written, but it will also perform identically to an instantiated template.

And type erasure is not a solution, it prevents inlining, constant folding and hoisting. Eg: In C++ std::vector<MyObject>::operator[] has 1 indirection, while using a generic C void* container would have 2. Guess which one is faster?

> Generic algorithms can be less optimized than a concrete solution.

sigh

Also wrong since generics do not prevent specialization if needed. See: static if in D, template specialization in C++.

parent p0nce 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton