Recently, I am interested in learning more about programming languages or platforms. I mainly focus on the current comparative process languages, such as. net, Java, Python, Ruby on Rails, and Perl. Next we will introduce them separately.
. Net
The. NET Framework is a cross-language solution developed by windows. Its core is the CLR (Common Language Runtime Library), which is an implementation of the CLI (Common Language infrastructure) specification released by Microsoft. CLI is divided into two parts, one is the common intermediate language, and the other is the CTS (common type system ). As you can imagine, based on a public-type system ,. net can translate data types in various languages into public data types, and then translate them into public Intermediate languages to achieve cross-language communication. Originally, the program is basically equal to the Data + process logic. After both parts use public specifications for constraints, it is possible to implement interoperability. This is also an embodiment of contractual programming.
In the. NET Framework, the compiler translates the language into an intermediate language during production, and transfers the language to the memory and runs it immediately before execution (that is, the JIT Mode. In addition ,. the runtime environment of. NET is similar to that of Java virtual machines. It is based on heap-based memory management mechanism, and there is no C-style pointer in hosting mode (it can be used for unmanaged code ); all have type systems ,. net is called metadata, and Java is a series of class object instances. Such a structure makes it easy to support such a mechanism as reflection, greatly improving program programming flexibility.
Java
Java is currently one of the most popular languages, and its advantages are cross-platform and mobile. It is based on the Java Virtual Machine architecture. The JAVA source program is translated as the bytecode of the. Class file. the Java Virtual Machine accepts these bytecode streams, parses and generates corresponding types of data, and starts running from the main method. The operations such as source code connection loading are completely handled by the virtual machine. Java and. NET are very similar. In terms of language, the syntax structure of Java and C # is very similar, and C # is the most convenient language in. net. However,. NET is mainly implemented based on Windows, while Java virtual machines have multiple operating systems. The former focuses on cross-language, while the latter focuses on cross-platform.
Python
Python is a relatively young language that has developed rapidly and has a growing number of users. This language gives me the impression that the encoding style is very demanding (originally, the program block was constrained by indentation ). The downside is that you have to be very careful when writing code. The advantage is that the general style of the written code is good and easy to understand. A powerful code library can be used to support the features of many upper-layer languages. Currently, it seems that many scripting languages are used (often compared with Perl). However, it is a general-purpose language and supports graphic development.
Its operating principle is roughly the same as that of Java, and there are also virtual machines. During execution, the source code is translated into an intermediate language and then loaded to the Virtual Machine for execution. Python can directly run the source code, but the process of converting the source code to the intermediate code is still executed first, and then explained and executed. Of course, for efficiency, you can also translate the source code into a. PyC bytecode file in advance and then explain the execution (which is similar to Java ). Compared with Java, I think the advantage of python is its ease of use. The code is concise and supports high-end features and dynamic types. It is a good choice for upper-layer languages.
Simple understanding is simple understanding. The main focus is here. If you have the opportunity in the future, go into some details.
For more information about these languages, please refer to them when necessary. I will not list them here.