News for hackers. Stuff that matters.
Re:Clay: A new language for generic programming (based on LLVM) by endtime on Monday July 26, 2010 @09:00AM (#1547871)
Why does Generic Programming require static types?
Re:Clay: A new language for generic programming (based on LLVM) by pohl on Monday July 26, 2010 @09:15AM (#1547907)
The type-parametric functions are inherently a feature of a static-typing system...so I guess "by definition" would be the answer. At least that's what the wikipedia entry would lead me to believe.

http://en.wikipedia.org/wiki/Generic_programming

See also: http://en.wikipedia.org/wiki/Type_polymorphism#Parametric_po...

Re:Clay: A new language for generic programming (based on LLVM) by Robin_Message on Monday July 26, 2010 @09:07AM (#1547889)
From the OP's definition, it needs static types so it can be compiled efficiently. You can do it dynamically (e.g. Ruby) but you can't do it as fast in general.

Additionally, generic programming is a computer science concept, and those types tend to prefer static-typing for safety reasons. They're probably not strictly necessary if you ignore efficiency.

Re:Clay: A new language for generic programming (based on LLVM) by klipt on Monday July 26, 2010 @03:14PM (#1548956)
Dynamic typing (ala Scheme or Python) gives you generic programming for free, but it's less efficient.