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 >