Language, platform, link library

xiaoxiao2021-03-06  40

There is a close relationship between language, platform, link library, and these three. This article tried to focus on the link library to explore the status between them.

Language and link library

Language usually accompanied by link libraries, there is no language that doesn't have a link library, and it can't write. For example, use the C language to write a small program printing Hello, you need to use the STDIO link library. Write the GUI program with Python, you need Tkinter link library.

Platform and link library

Platform usually also accompany the link library, there is no link to the link, is equal to the program that does not want others to develop this platform. For example, you want to develop Windows programs with Visual C 6, you need to use link libraries such as GDI32 and user32 or MFC. Write the Mac OS 9 program that requires a Carbon link library.

Link Link Link Library for Platform

Using B language on a platform, you will face the link library and B language link library at the A platform. This two link is not allowed to be 100%, especially the memory. When management, resource management, execution, etc., and the operating system have a close relationship. If you want a feature to be available in the A platform's link library and B language link library, you should use the A platform link version of the library, usually safe. For example, develop Windows platform programs with C language, if you want to configure memory, then you should call the Win32 API version (for example, globalalloc ()), instead of the C language version (for example, Malloc ()).

Cross-platform link library

What can you be executed for the program developed for a platform, can you execute after re-compiling other platforms? The problem is on the platform's link library. For example, you use the C language to match the C standard link library and Win32 link library, develop a presentation software WeakPoint 2000 on the Windows platform; you get the original program of WeakPoint 2000 to compile, but you can't compile success, problem There is no Win32 linker in Linux.

Then, if there is a link library to extract the link library extracts of each major platform (Abstract), you can solve this problem. For example, QT is doing this, your C program If you only use a standard C link library and QT link library, you can re-compiling the program after performing the program (Linux, UNIX, Windows) on different platforms.

Language Platform Link Library

Java is even more, not only will the link library will be unified, but also uncheck the platform, that is, the program does not need to be recompiled, it can be directly executed. But it also, a layer of JVM, sacrifices part of the efficiency.

Cross-language link library

Borland's VCL link library is a set of link libraries that are quite well received on the Windows platform, which can be used by C and Object Pascal (Delphi). In fact, "Linked Link Link Library" is not a very good statement. After all, many languages ​​can be connected to the external native link library, and the two do not need to be the same language. But whether such a link requires a lot of common regulations, there is a considerable difference. Delphi and C Builder use VCL are quite convenient.

Mac OS X, which is about to come out this month, provides a Cocoa link library. The Cocoa Link Library can be used in Objective-C and Java languages. Objective-C and Java Language Edition Cocoa Link Library Similarity is 90%. Java is simplified into a pure language in Mac OS X's native program, which does not use Java's API, which only uses a Cocoa link library. This is quite special. (Of course, Mac OS X also has JVM to support general J2SE) language specifications platform link library = Bao Shan Baohai?

.NET is higher than Java's vision, and even prepares the language specifications to be unified. The .NET has a CLS (Common Language Specification), any language as long as the CLS standard can easily integrate the .NET platform, enjoy the resources of the .NET platform. This is that Java is not over. Although other languages ​​can design a compiler to compile the program into Java Bytecode, execute on the JVM, but Java does not provide direct support, so it is difficult to transplant a language to Java, which is difficult than transplanting a language. Net.

Although the .NET allows various languages, but in response to CLS, each language often needs to make a compromise to change the language itself, saying that Visual Basic's change is great (Visual Basic 7 is almost a new language), and Jscript And Visual C language has also changed. The language neutrality of this way is undoubtedly cutting. With CLS specifications, these languages ​​have become consistent, and the thinking model is exactly the same, there are only some small differences in slightly. Historical will prove that C # will be a large language on the .NET platform, other languages ​​on .NET will become embellished, so, the interrogation of the language has become a scorpion. Although I am very embarrassed to .NET language, I really like .NET Framework, I can't help but thumbs up. Net framework is "gang bamboo".

The language specifications and link libraries of .NET are unified. Destinous Eiffel regards .Net as a life-saving floating wood, ready to transplant Eiffel to .NET, but in this way, Eiffel will give up the Windows dedicated link library Wel (Windows Eiffel Library) and cross-platform links. The library (more than EiffelVision et al.). Does Eiffel have not found that the float it acts, is actually a crocodile?

The same problem will also occur on Delphi, if Delphi is ready to port it to .NET, a part of the language characteristics must also be changed, and may have to give up using VCL (CLX) on .NET. Delphi did not do this.

The most chaotic era, the best choice

After reading this article, you may have a dizzy. It doesn't matter, you just remember the following sentence is good: the most chaotic era, the best choice ... Java.

转载请注明原文地址:https://www.9cbs.com/read-73265.html

New Post(0)