Future reading notes for code < two >

Source: Internet
Author: User

The future of code reading notes < two >3.1 language design

The 2 angles of the ruby JavaScript Java Go from the server client side and static dynamics are compared. These four languages have different design styles due to different design policies.

Header Client Service Side
Dynamic Html5 Ruby
Static Java Go
static dynamic
    • Static: The results can be determined only by program code, without actually running.
    • Dynamic: Results can be determined only at run time. But no matter what the program, more or less contains the dynamic characteristics.
Dynamic operation mode

A running program recognizes itself and operates on its own. Programming of the program itself, called meta-programming (metaprogramming)

Ducks are like ducks.

If an object behaves exactly like a duck, we can think of it as a duck, no matter what his real entity is. We don't have an instance of what class the object is, only about what kind of behavior it has.

Go, Dart, Coffeescpript, Lua

The syntax differences between the 4 languages are described, and the optimizations that have been made by the compilers

Languages that are significantly faster

In more terms, performance is related to the nature of the engine, and the type of language is irrelevant

Jit

Just in time Compiler refers to the technique of compiling a machine language while the program is running.

Specialization

Refers to a technique used when converting a function to an internal expression. By assuming that the parameter is of a particular type, prepare a specialized high-speed version beforehand, perform type checking at the beginning of the function call, and run the high-speed version directly when the precondition is established. One of the reasons for the slow speed of a dynamic language is that it needs to be accompanied by a large number of type checks at run time, and this disadvantage can be circumvented by specialization.

Future reading notes for code < two >

Related Article

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.