6 ms·
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
by nvader 6y ago
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).
- deleted 6y ago[deleted]
- samatman 6y agoIn ML, your value moos. It is inferred to be a cow. In Ruby, your value moos. Could be a cow; might be a MooDuck. Do you really care?
- grawprog 6y agoIn Assembly, there is no cow, no mooing, there's a bunch of places where parts of cows and moos may or may not be stored. It's up to you to pick the parts of the cows and moos in the correct order, then send the numbers representing the places where the cow and moo parts are stored to a magic box that interprets your sequence of numbers and puts the cow into the correct order after which you jump over to the cow and tickle its belly until it moos.
- leloctai 6y agoSo what's the difference between ruby and python?
- ClikeX 6y agoDuring the Ruby's runtime the cow might get monkeypatched into a bat.
- tomp 6y agoIn Ruby, the cow moos automatically.
- shadowgovt 6y agoAbout 3 seconds, depending on how many cows you have. ;)
- dllthomas 6y agoIn ML, it's inferred if it might, in any potential future, moo.
- keybuk 6y agoIn Swift, if cow is a reference type you all share a cow that moos whoever asks, but if cow is a value type then you all have your own copy of a cow that only moos for you.
- tgv 6y agoThat doesn't make any sense.
- ealhad 6y agoIn Rust, you have a Cow. It's smart and allows you to clone borrowed things, including things which can moo.
- Joker_vD 6y agoBut only clones on write, which is a useful optimization.
- kitd 6y agoDidn't think Python had duck typing...
- dllthomas 6y agoWhat do you think "duck typing" is? Historically, it feels like I've mostly heard the term applied to Python. Edited to add: Please don't take my question as rhetorical attack - it was intended as inquiry. There may be different definitions floating around.
- kitd 6y agoWell, there we are. I don't know Python so, both jokingly and literally, I didn't know Python had duck typing.
- TheOtherHobbes 6y agoIn 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.
- nicoty 6y agoYou mean https://github.com/moonad/Moonad https://github.com/moonad/Moonad ?