October 29, 2012
On 10/29/12 2:16 PM, bearophile wrote:
> Andrei Alexandrescu:
>
>> Yes, but what gets ignored here is that typeclasses have a large
>> cognitive cost to everyone involved.
>
> Such costs are an interesting discussion topic :-)
>
> To put people up to speed a bit:
> http://en.wikipedia.org/wiki/Type_class
>
> A bit of explanations regarding Rust ones:
> https://air.mozilla.org/rust-typeclasses/
>
> Deeper info from one of the original designers:
> http://homepages.inf.ed.ac.uk/wadler/topics/type-classes.html

For those who wouldn't know how to search the Net, these indeed are quite appropriate.

>> I think typeclasses generally don't pull their weight.<
>
> Rust and Haskell designers think otherwise, it seems.

It's a matter of what priorities the language has and what other features are available overlapping with the projected usefulness.


Andrei
October 29, 2012
Andrei Alexandrescu:

> For those who wouldn't know how to search the Net, these indeed are quite appropriate.

People are often a bit lazy in clicking on links present in newsgroup messages, and they are even more lazy in searching things. So I've seen numerous times that if you give them links they will be more willing to read. This is especially true about topics they know nothing about, because they have a higher "cognitive impedance".

Google gives many results about this topic, but not all of them are good. That link from mozilla is a little video that doesn't tell a lot. The papers from Wadler were the ones Haskell typeclases come from, they are harder, but they are more fundamental. But starting from those papers is hard, so better to start from some examples and simpler explanations.

In the Haskell wiki there are more practical texts on this topic, and comparisons:
http://www.haskell.org/tutorial/classes.html
http://www.haskell.org/haskellwiki/OOP_vs_type_classes

Plus an online free chapter of what maybe is the best book about Haskell:
http://book.realworldhaskell.org/read/using-typeclasses.html


> It's a matter of what priorities the language has and what other features are available overlapping with the projected usefulness.

I agree. On the other hand the main point of this thread is that someone perceives as not good enough or not sufficient the current features of D. Even if their perception is wrong (and you are an expert on this field, so we trust your words), I think the topic is worth discussing.

Bye,
bearophile
October 29, 2012
On Monday, 29 October 2012 at 17:56:26 UTC, Andrei Alexandrescu wrote:
>
> We will not add C++ concepts or typeclasses to D.

Ok. There is no point continuing this discussion then.

1 2 3
Next ›   Last »