I would pay good money for a comparison of type systems, delivered in the vein of Cow Economics. 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).
Type Systems Explained with Examples
21–30 of 34 posts
Re: Type Systems Explained with Examples
#22I would pay good money for a comparison of type systems, delivered in the vein of Cow Economics. 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).
This pattern is called a Moonad.
Re: Type Systems Explained with Examples
#23I suspect the use of “semantic” where it should be “semantics” is explained by the French author translating “semantique” a little too directly.
Why does English has all those random "s" at the end of the Greek-borrowed words? AFAIK, most other languages that borrowed the same words don't have those.
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."
Re: Type Systems Explained with Examples
#24I would pay good money for a comparison of type systems, delivered in the vein of Cow Economics. 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).
Didn't think Python had duck typing...
Edited to add: Please don't take my question as rhetorical attack - it was intended as inquiry. There may be different definitions floating around.
Re: Type Systems Explained with Examples
#25I would pay good money for a comparison of type systems, delivered in the vein of Cow Economics. 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 Haskell mooing is an impure side effect. It has to be handled with a special design pattern - which recursively generates further side effects, including an infinite number of online tutorials which fail to explain what it does. This pattern is called a Moonad.
Re: Type Systems Explained with Examples
#26> or to perform “impossible” operations, like division by 1. This looks like a mistake.
Re: Type Systems Explained with Examples
#27I suspect the use of “semantic” where it should be “semantics” is explained by the French author translating “semantique” a little too directly.
Re: Type Systems Explained with Examples
#28Earlier quoted context omitted.
Why does English has all those random "s" at the end of the Greek-borrowed words? AFAIK, most other languages that borrowed the same words don't have those.
Found an interesting paper on this! 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.…
Re: Type Systems Explained with Examples
#29If anyone is interested in Type systems and what's a type, I highly recommend watching the first 20 mins of Sean Parent's presentation: https://youtu.be/sWgDk-o-6ZE It will change the way you think about types after this.
That video is titled 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 Types
Both 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.