Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>1) Apparently, there are others: <a href="http://en.wikipedia.org/wiki/Type_system" rel="nofollow">http://en.wikipedia.org/wiki/Type_system</a></p> <p>2)</p> <p><code>Dynamic</code> => Type checking is done during runtime (program execution) e.g. Python.</p> <p><code>Static</code> (as opposed to Dynamic) => Type checking is done during compile time e.g. C++</p> <p><code>Strong</code> => Once the type system decides that a particular object is of a type, it doesn't allow it to be used as another type. e.g. Python</p> <p><code>Weak</code> (as opposed to Strong) => The type system allows objects types to change. e.g. perl lets you read a number as a string, then use it again as a number</p> <p><code>Type safety</code> => I can only best describe with a 'C' statement like:</p> <pre><code>x = (int *) malloc (...); </code></pre> <p><code>malloc</code> returns a (void *) and we simply type-cast it to (int *). At compile time there is no check that the pointer returned by the function malloc will actually be the size of an integer => Some C operations aren't type safe.</p> <p>I am told that some 'purely functional' languages are inherently type safe, but I do not know any of these languages. I think Standard ML or Haskell would be type safe.</p> <p>3) "If a language allows you to change the type of a variable in runtime (e.g. a variable that used to store an int is later used to store a string), what category does that fall in?":</p> <p>This may be dynamic - variables are untyped, values may carry implicit or explicit type information; alternatively, the type system may be able to cope with variables that change type, and be a static type system. </p> <p>4) Python: It's dynamically and strongly typed. Type safety is something <em>I</em> don't know python (and type safety itself) enough to say anything about.</p> <p>5) "Is there anything else I should know about type systems?": Maybe read the book @BasileStarynkevitch suggests?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload