Live data from Hacker News

Type Systems Explained with Examples

thevaluable.dev

1–10 of 34 posts

Re: Type Systems Explained with Examples

#3
post #2

If 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.

yes, this video is excellent

Re: Type Systems Explained with Examples

#4
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).

Re: Type Systems Explained with Examples

#5
post #4

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]

Re: Type Systems Explained with Examples

#6
post #4

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).

In 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?

Re: Type Systems Explained with Examples

#7
post #2

If 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

Re: Type Systems Explained with Examples

#8
post #7
post #2

If 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

[deleted]

Re: Type Systems Explained with Examples

#9
post #2

If 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.

I watched it, very much looking for some illumination. But it was just an exhaustive and formal definition, not giving any insight (and not appearing to attempt to)

Maybe I missed something, or maybe I need to watch more. Can you explain why you recommend this segment in more detail?

Re: Type Systems Explained with Examples

#10
post #6
post #4

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).

In 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?

In 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.
Post reply on HN