[Base] - from xx is a cross-platform language Speaking

I often come across some people are saying xx and yy language cross-platform language is not (in order to avoid unnecessary disputes, not written in this particular language but does not affect the reading), so as to show their use xx language program development and then in the programming language very lofty sense of superiority on the contempt chain.

Probably from the beginning "Write once, Run anywhere" put forward the slogan of Java, the concept of cross-platform began to pop up (I'm not entirely sure time is not high degree of overlap, so the use of "probably" is the word).

Here I take the example Java language to explain the child, from the beginning to the encoding process actually executed is: write source code (.java) file -> compiler into bytecode (.class) file -> various deploy or distribute -> started on the computer -> computer load resources -> program found to be Java programming -> call JVM-> JVM .class file parsing -> JVM executes the program. We can see in real execution of the program by the computer itself performs the steps of loading resources have to call the JVM section, when the JVM .class file parsing and execution process is not delivered directly to the computer to perform the JVM but have to be responsible, this is why this mechanism is called the JVM is running a managed environment.

So Java is how to achieve specific cross-platform it? Of course, the JVM is to achieve various operating system platforms (Windows, Linux and Mac series) by Java developers (after first Sun is Oracle), the need to achieve support the deployment of the platform is installed on the corresponding JVM (JVM platform and which it needs to be called together lib JRE) to run Java programs can be realized in the ability of the platform. So, Java language development program itself is not cross-platform but there are various platforms corresponding JVM version, Java can be run under various platforms in the strict sense; from the point of view of our programmers to develop programs for the Java program can be simplified It has the ability to cross-platform. When the program is actually delivered to the JVM (JRE) when it does not concern the implementation of the program is not written in Java language into which merely interprets and executes the class file (.class), the implementation of such programs written in other languages ​​for the JVM offers convenient.

Other languages ​​that have the ability to do cross-platform, such as C language? C language with respect to the Java process from development to operation of the process is different: the development of source code files (.c) -> compiler to compile source code -> Run. In the process there is no compiler to compile the source code is compiled into an intermediate result but programming has become a corresponding machine code (or Windows or Linux or Unix, etc.), when the program is executed directly by the CPU to perform interpretation, so C language development in this program does not have the enforcement mechanism is cross-platform capability to perform.

Then there is no enforcement mechanism other similar programs do? Yes, of course, such as in C # .NET-based programming language system, its principles and cross-platform Java is basically the same, but the virtual machine is not called JVM but called the CLR ( C ommon L anguage R untime), from the name we can Common seen that the variety of programming languages is not limited, as long as the compiler can be programmed to conform to the standards of the intermediate layer performing the CLR (.class Java language similar to the system) to the intermediate layer is called the name IL, the full name is the MSIL ( M icro S OFT I ntermediate L anguage), and set standards is the CLS ( C ommon L anguage S pecification). But for some consideration in Microsoft .NET introduced only 10 years in the CLR implements the Windows platform and has failed to launch Linux-based CLR, although there are other companies trying to launch MONO, but not the intensity is not too much the industry influence. In 2014, after Microsoft launched .NET Core, and simultaneously launched a corresponding Runtime various platforms.

Up to now, its Java-related patents are held by the Company, any place there is conflict of these patents are likely to be at risk of legal proceedings, such as the year Microsoft targeted optimization Java execution performance and efficiency specially developed for Windows platform the Visual J ++ package is being sued because the issue of Sun's patents and awarded compensation.

The standard C # and other .NET programming system are ECMA standard, and here I look at that link is no longer a simple column in detail:

Common Language Infrastructure(ecma-335)

C# Language Specification(ecma-334)

Any company or individual strength with ideas can be carried out based on these open standards corresponding development, but most of the company at a competitive but Microsoft's position not to put in more resources in this area, but there are very few companies have been tried, such as Borland's Delphi.NET.

Had Java and C #, about cross-platform, related to .NET Core, etc., which have a lot to say, not just a few articles describe clearly, there is a need to understand the situation of these students is a priority to see a variety of official documents, we can only infer from the interpretation of a variety of secondary sources.

Follow-up also plans to write a .NET process and logic execution in the Windows platform, hoping to achieve.

Guess you like

Origin www.cnblogs.com/lidongjia/p/11834379.html