Re:If Java Is Dying, It Sure Looks Awfully Healthy
by quchen on Thursday October 10, 2013 @08:14AM
(#6526993)
Yes, there are languages that also have these features, the puzzling part is why not all of them do (except those that may have good design reasons not to).
Re:If Java Is Dying, It Sure Looks Awfully Healthy
by ufo on Thursday October 10, 2013 @08:51AM
(#6527240)
Its hard to implement type inference and type classes unless you carefully design the language to accommodate it from day 1. For example, return-type polymorphism (functions like `read` or `return`) is particularly tricky, specially in the more dynamic languages.
C# also sort of implements type classes. For your example, there's IComparable in C#; implement it and a List<SomeObject> can be directly sorted.
For pure functions, there's the [Pure] attribute, but it isn't enforced by the compiler, it's just a contract, a promise.