Assuming we're talking about the same thing, the classic, and very successful, example of generic programming in the real world is the STL framework in C++, which was built on the C++ template mechanism. More recently, the Boost library extends this approach (see this survey of Generic Programming Techniques in Boost).
"The importance of the C++ Standard Template Library, STL, lies more in its concepts than in the actual code or the details of its interfaces" - David Musser. He's right, but in addition to that, the approach has proven itself in a lot of real-world code - it enables the use of high-level abstractions which retain a high degree of efficiency. (See the SGI page on STL for more info.)
My personal experience of generic programming in C++ is that it makes the language feel like a much more dynamic language than it "is", although I think a large part of this is simply due to the consistent use and application of interfaces, as Noel suggested. Most libraries and frameworks are not decomposed to the level which generic programming libraries tend to be. Good generic libraries are typically excellent examples of reusability and good component design, that can put the type systems of many languages to shame (in a practical sense at least - I don't know about the formal perspective).
One example shown on the Boost page linked above, is a generalized copy function that can copy elements in both arrays and linked lists, for example. Traditional naively-typed languages (new term :) don't let you do this kind of thing at a low level - although some really should, IMO. There's such a big focus on abstraction in the better computer languages, so why the heck can't we abstract the same concept (e.g. copying elements) over multiple data types, without having to jump through hoops?
One language to watch in this space is Goo. I don't know enough about it myself, and it doesn't help that it has a rather cryptic set of two-letter function names which makes it look a bit like a Lispy version of APL, without the greek characters...
|