language agnostic - Is my understanding of type systems correct? -


The type of the following statements reflects my understanding of the system (which java is suffering from outside the world on very little hands) ; Please correct any errors.

Fixed / dynamic distinction looks clear:

  • Static typed langauges assigns each variable, field and parameter to a type and compiler Prevents the work between incompatible types. Examples: C, Java, Pascal.
  • In dynamically typed , variables are treated as normal bins, which can keep anything you want - types of types only on runtime Checks (if only) actually act on values, when you assign them. Example: Smalltalk, Python, JavaScript.
  • Type typing types with type orientation contexts (and have some advantages) to look like people typed in dynamically, so that you do not need to declare them most of the time - But in dynamic languages, you can not do this, use a variable to start a string, and then assign an integer. Example: Haskell, Scala

I have a strong / Weak distinguish I'm pretty sure about it, and I doubt it is clearly not clear:

  • Fully typed languages ​​have a value of one type Type facility and only permitted for such type of operation is allowed, otherwise there is a clear error.
  • Runtime type is not checked in Vulnerable typed languages ​​- if you try to do an operation at a price that does not support it, then The results are unpredictable It can do something really useful, but it is more likely that you will get corrupted data, accident, or some immature secondary error.
  • At least two different types of weak typed languages ​​(or perhaps in C and Edibler, there are basically buckets of buckets, so anything is possible and if you have 4 bytes before a redundant string If you get the compiler to define, then there is a better hope that it is somewhere, the legal machine code is not included in it.
  • PHP and JavaScript are usually typed vulnerable, but the value Opaque However, they will fulfill the implicit type of conversions.
  • But the built-in conversion primarily for string / integer / float variables Are applicable - Is the classification really typed vulnerable? Or are there other issues where the type of these languages ​​can obscure the system errors?
  • < P>

    I'm pretty sure about strong / weak differences, and I suspect that this is not very clearly defined.

    You are right: it is not.

    This is the author of Benjamin C., the type of type and programming languages ​​ and advanced type and programming language . Pierce:

    I spent a few weeks ... " strongly typed ," steady type , "" Safe, , "etc., and found it surprisingly difficult ... these words are too much to use because they have to provide almost useless.

    In Luca Cardelli, in their typewriting programming article, this is an application for uncontrolled run-time type errors. The situation defines Tony Hore as saying that accurate property "security" other papers call it "type protection" or just "security".

    Comp During the discussion on the lang.perl.moderated news group, whether in Pearl or not, strongly typed in this rant, he said that within a few hours of research, he would get 8 different, sometimes obtaining contradictory definitions Most college was able to Specially, those texts were included in those texts that were used to help students differentiate between strongly typed languages ​​and those from reputable sources such as reviewed papers or equivalent papers. , And according to those examples, the type is strongly typed, the type is vulnerable, C ++ is strongly typed, C ++ is weakly Aip is, Lisp was strongly typed, Lisp has been weakly typed, typed Pearl strongly typed Pearl weakly. (Which clarifies any confusion?)

    only definition that I have consistently applied:

    • strongly typed : My programming language
    • Weak type : Your programming language

    Comments

    Popular posts from this blog

    oracle - The fastest way to check if some records in a database table? -

    php - multilevel menu with multilevel array -

    jQuery UI: Datepicker month format -