Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are asking a lot here :) Type system is a dedicated field of computer science!</p> <p>Starting from the begining, "a type system is method for proving the absence of certain program behavior" (See <a href="http://www.cis.upenn.edu/~bcpierce/tapl/" rel="nofollow">B.Pierce's Types and Programming Languages</a>, also referred in the other answer). Programs that pass the type checking is a <em>subset</em> of what would be valid programs. For instance, the method </p> <pre><code>int answer() { if(true) { return 42; } else { return "wrong"; } } </code></pre> <p>would actually behave well at run-time. The else branch is never executed, and the answer always return 42. The static type system is a <em>conservative</em> analysis that will reject this program, because it can not prove the absence of a type error, that is, that "wrong" is never returned. </p> <p>Of course, you could improve the type system to actually detect that the else branch never happens. You want to improve the type system to reject as few program as possible. This is why type system have been enriched over the years to support more and more refinement (e.g. generic, etc.)</p> <p>The point of a type system is to prove the absence of type errors. In practice, they support operations like downcasting that inherently imply run-time type checks, and might lead to type errors. Again, the goal is to make the type system as flexible as possible, so that we don't need to resort to these operations that weaken type safety (e.g. generic). </p> <p>You can read chapter 1 of the aforementionned book for a really nice introduction. For the rest, I will refer you to <a href="http://blogs.perl.org/users/ovid/2010/08/what-to-know-before-debating-type-systems.html" rel="nofollow">What To Know Before Debating Type Systems</a>, which is awesome blog post about the basic concepts. </p> <blockquote> <p>Is there anything else I should know about type systems?</p> </blockquote> <p>Oh, yes! :)</p> <p>Happy immersion in the world of type systems!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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