In my opinion, the purpose of types is to help our brain to cope with abtract concepts. They are ergonomic tricks that help us (developpers) classify and manipulate the raw programming material. The closest they are to real-world objects (think OOP), the easiest the learning curve.
This implies that if you are building languages for machines (e.g. for CPUs, for VMs), types may be forgotten. No ?
Prior to exposure to Haskell I would have said much the same as Denis. Now I see types as not only providing safety (I am prevented from certain dangerous habits, like dereferencing a null pointer w/o REALLY wanting to), but also as able to describe data. For example, types can be used to describe the structure of a database table, and used to verify any queries against that table.
Your use of "pattern"/"constraint" and "rule" have that same meaning.
I have also seen types used to describe how resources are used (or when they are used). Your use of "allocator"/"constructor" connects with that meaning.
My understanding of "nominal" vs. "structural" is that types have name equality vs. "shape" equality. Again, after using Haskell, I find C#'s (pre 3.5) lack of "structural" typing really painful. Especially with anonymous delegates of IEnumerable, you really want tuples (i.e. anonymous types) and that means you want structural equality. The rest of the time, though, nominal typing seems to be much simpler.
The interesting thing about nominal is that values maintain a relationship to their type, and that you can build up relationships between nominal types (e.g., inheritance).
The interesting thing about nominal is that values maintain a relationship to their type, and that you can build up relationships between nominal types (e.g., inheritance).
7 comments:
In my opinion, the purpose of types is to help our brain to cope with abtract concepts. They are ergonomic tricks that help us (developpers) classify and manipulate the raw programming material. The closest they are to real-world objects (think OOP), the easiest the learning curve.
This implies that if you are building languages for machines (e.g. for CPUs, for VMs), types may be forgotten. No ?
Prior to exposure to Haskell I would have said much the same as Denis. Now I see types as not only providing safety (I am prevented from certain dangerous habits, like dereferencing a null pointer w/o REALLY wanting to), but also as able to describe data. For example, types can be used to describe the structure of a database table, and used to verify any queries against that table.
Your use of "pattern"/"constraint" and "rule" have that same meaning.
I have also seen types used to describe how resources are used (or when they are used). Your use of "allocator"/"constructor" connects with that meaning.
My understanding of "nominal" vs. "structural" is that types have name equality vs. "shape" equality. Again, after using Haskell, I find C#'s (pre 3.5) lack of "structural" typing really painful. Especially with anonymous delegates of IEnumerable, you really want tuples (i.e. anonymous types) and that means you want structural equality. The rest of the time, though, nominal typing seems to be much simpler.
Types are proofs.
http://en.wikipedia.org/wiki/Curry-Howard_isomorphism
The interesting thing about nominal is that values maintain a relationship to their type, and that you can build up relationships between nominal types (e.g., inheritance).
The interesting thing about nominal is that values maintain a relationship to their type, and that you can build up relationships between nominal types (e.g., inheritance).
thanks for sharing perfect site ı am coming everday here
sesliserbest
sevgiadresi
seslidünya
thanks for sharing perfect site ı am coming everday here
sesli chat
sesliyes
seslimazi
konya chat
seslimazi
hollanda chat
bu sitede porno izlerken 31 çekebilirsiniz, türk kızlarının webcam sex filmleride burada, dilerseniz grup sex filmleride burada. çıtır liseli porno videosu izleyin. en kral türbanlı porno izleme yeri ve hergün güncellenen porno arşivi bu sitede. erotik shop ve geciktirici siparişi.
Post a Comment