Type Systems Explained with Examples
thevaluable.dev
thevaluable.dev
In Self, you have a cow. You ask the cow to moo. It moos.
In Java, you have a cow. You construct a CowMooFactory to create an MooIpml. The MooImpl moos.
In Python, you have a cow. You ask it to moo. It quacks.
In C, you have a pointer to a cow. You ask it to moo. Segmentation fault (core dumped).
In Ruby, your value moos. Could be a cow; might be a MooDuck. Do you really care?
Edited to add: Please don't take my question as rhetorical attack - it was intended as inquiry. There may be different definitions floating around.
This pattern is called a Moonad.
It will change the way you think about types after this.
CppCon 2015: Sean Parent "Better Code: Data Structures"
Did you mean instead this video? https://www.youtube.com/watch?v=mYrbivnruYw Goals for Better Code - Implement Complete TypesBoth talks are interesting. Both are from a very C++ perspective, particularly the one you suggest. That doesn't make them wrong, by any means. Much of it generalizes, although depending on your background it might take varying amounts of effort to understand the generalizations.
In the first talk in particular, I think he conflates (in a small way) type with representation in a way that's... not... ideal? But I don't think it does a lot of harm to the talk; he has very interesting things to say particularly about representation.
Some of the point of both talks overlaps with the common admonishment to "make illegal states unrepresentable", but I don't think any fully implies the other.
For a very different perspective on types, I highly recommend watching https://www.youtube.com/watch?v=3U3lV5VPmOU, although I don't highly recommend actually programming this way.
Maybe I missed something, or maybe I need to watch more. Can you explain why you recommend this segment in more detail?
The entire talk is about memory layouts and how nothing has a meaning unless we ascribe a meaning to it.
I don't really know what this has to do with types, or type systems, which are an algebraic concern, as far as I'm concerned.
https://www.tandfonline.com/doi/pdf/10.1080/00437956.2007.11...
"The morphology of English words like dependence, linguistics, and news suggests that English has an /-s/ suffix forming certain kinds of abstract nouns not used as plurals. While dependence and dependents are homophones, the former takes singular verb agreement, as do linguistics and news, and the latter takes plural. We argue that English has a highly productive derivational suffix /-s/ that creates abstract nouns from adjectives, dependence from dependent + /-s/, linguistics from linguistic + /-s/, and news from new + /-s/. While this suffix originated in the Latin present participle, the sources of a modern /-s/ came into English through extensive borrowing from Latin and French as well as through loan translation and borrowing of Greek words, but then it combined with existing English /-s/ that marked plural or genitive. Orthographic, phonological, morphological, and semantic evidence suggests that this modern /-s/ arose from several distinct sources that came together as a single suffix in the early 171h century."
This looks like a mistake.