[Reprint] Dynamic Language static Language

Source: Internet
Author: User
] Dynamic Language static Language

After reading fantasysoft's "also known as type inference", I felt it was necessary to clarify some terms.

Three terms are confusing:

  1. Dynamic Programming Language (Dynamic Language or dynamicProgramming Language)
  2. Dynamically typed language (Dynamic Language)
  3. Statically typed language (static type language)

FantasysoftArticleThe mentioned Dynamic and Static languages actually refer to dynamic and static languages.

Dynamic language, to be precise, refersProgramYou can change its structure at runtime: new functions can be introduced, existing functions can be deleted, and other structural changes. For example, the well-known ecmascript (JavaScript) is a dynamic language. In addition, Ruby and Python are also dynamic languages, while C and C ++ are not dynamic languages.

The so-called dynamic type language means that the type check is performed at runtime, for exampleCodeIs it legal? It must be determined at runtime (note that it is the type of runtime ):

Def sum (A, B ):
Return A + B

For example, C # Is a static type language. To achieve polymorphism, the static type language uses some type identification methods, for example, inheritance and interfaces are not required for dynamic language, so dynamic typing is usually used for Dynamic Language. (Idior doesn't know if I can answer your question about Dynamic Language polymorphism. ^_^)

Here we need to clarify whether the dynamic type language is completely irrelevant to the type security of the language. do not associate them!

The main advantage of static type language is that it has a very standardized structure, which facilitates debugging and facilitates type security. The disadvantage is that more type-related code needs to be written, which makes it hard to read and understand. The advantage of dynamic type language is that it is easy to read and does not need to write a lot of type-related code. The disadvantage is that debugging is not convenient, and reading or understanding may occur when the naming is not standard. By the way, there is a trend that combines dynamic and static types in one language, so that you can learn from each other when necessary, boa is a good experimental example. Pai_^

Finally, Boo is a static type language. Although duck typing can simulate dynamic typing, duck does not support replacement of all types of operations, therefore, even if duck typing is used completely, the dynamic typing cannot be reached. As described in fantasysoft, type inference is not a feature of a dynamic type language, so supporting type inference does not mean that the language is dynamically typed.

Let's talk about VB. NET ^ _ ^ for the fans of ninputer. VB. NET is a dynamically typed language.

Reference

Http://en.wikipedia.org/wiki/Dynamically_typed_language
Http://en.wikipedia.org/wiki/Dynamic_programming_language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.