当前位置:网站首页>. net cross platform principle (Part I)
. net cross platform principle (Part I)
2022-04-23 17:04:00 【begeneral】
1、.NET Framework hierarchy
FCL(Framework Class Library) |
BCL(Basic Class Library) |
CLR(Common Language Runtime) |
FCL: This is a for developers API Class library , For example, the framework we often use :Windows Forms、ASP.NET、WPF、WCF etc. . This layer is directly oriented to developers .
BCL: This is the class library at the bottom , Provide code that interacts with the operating system level , Such as :IO、 Thread management
CLR: It provides a managed execution environment for programs , yes .NET Framework Execution engine for .CLR And .NET The relationship of is equal to JVM And Java The relationship between ,CLR It's essentially .NET Virtual machine .
2、CLI
To achieve cross platform , The two types of differences must be addressed : Differences in programming languages and runtime environments . Only programming languages can achieve mutual compatibility , The runtime environment can be unified , Cross platform can be realized .CLI To solve such a problem : Developed by different high-level programming languages .NET Applications can run in different system environments without any change .
CLI Full name :Common Language Infrastructure. among Common Language It refers to the common language , It aims to solve the compatibility problem of various high-level development languages .Infrastructure Refers to the runtime environment , It aims to make up for the differences in execution methods between different platforms .
Programming languages are divided into two types: compiled and interpreted . The former needs to be compiled by the compiler to generate executable code ,CLI It involves compiled languages . To achieve true cross platform , The final problem to be solved is the compatibility and portability of executable code between different platforms . If the executable code generated by different programming languages after compilation is the same , So the difference between programming languages is no longer a problem .
2.1、CIL
according to CLI The provisions of the , Used to describe executable code is a kind of code called CIL(Common Intermediate Language) Language , This is an intermediate language between high-level language and machine language . Although the program source files are written in different programming languages , But we can compile it into CIL Code . In principle , Design a new programming language and add it to .NET in , You only need to use the corresponding compiler to generate a unified CIL The code can be . We can also design a compiler , take java The code is compiled to CIL For the target language . If you say so , In fact, programming languages are just appearances , Object code ( Also known as executable code ) That's the essence. , Because the object code deals directly with the computer . Now draw a picture to illustrate the function of intermediate language .
The differences of programming languages are unified through the compiler , The difference of running environment can be realized through virtual machine (VM) Technology to solve . Virtual machine is CIL Execution container for , Be able to perform CIL The code is dynamically translated into machine instructions that match the current execution environment by means of real-time compilation . Virtual machines mask the differences between different operating systems , So that the target program can run in different underlying execution environments without any modification .
That's the logic ,.NET The application should be able to work in non windows The platform is running , Why in the non windows The platform still doesn't work ? My personal understanding is : Microsoft didn't realize non - windows Virtual machine of platform , That is to say CLR. In other words, Microsoft has only realized windows Platform CLR, therefore .NET Applications can only be windows Platform execution .
版权声明
本文为[begeneral]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230554082479.html
边栏推荐
- Generate random numbers with high quality and Gaussian distribution
- Website_ Collection
- Decimal format decimal / datetime conversion processing
- [problem solving] [show2012] random tree
- ◰GL-阴影贴图核心步骤
- Derivation of Σ GL perspective projection matrix
- Collect blog posts
- 【解决报错】Error in v-on handler: “TypeError: Cannot read property ‘resetFields’ of undefined”
- Use between nodejs modules
- [markdown notes]
猜你喜欢
详解牛客----手套
Installing labellmg tutorial in Windows
Derivation of Σ GL perspective projection matrix
Bottom processing of stack memory in browser
How to build tiktok user trust and drive fan growth
Modify the test case name generated by DDT
Idea of batch manufacturing test data, with source code
PyMySQL
ACL 2022 | dialogved: a pre trained implicit variable encoding decoding model for dialogue reply generation
Rtklib 2.4.3 source code Notes
随机推荐
PHP高效读大文件处理数据
Lock lock
Tencent resolves the address according to the IP address
ACL 2022 | dialogved: a pre trained implicit variable encoding decoding model for dialogue reply generation
Promise (III)
Collect blog posts
博士申请 | 厦门大学信息学院郭诗辉老师团队招收全奖博士/博后/实习生
Zhongang Mining: Fluorite Flotation Process
Sub database and sub table & shardingsphere
Customize my_ Strcpy and library strcpy [analog implementation of string related functions]
∑GL-透视投影矩阵的推导
How does flash cache data in memory?
批量制造测试数据的思路,附源码
Linux MySQL data timing dump
oracle 中快速获取表的列名列表
手写事件发布订阅框架
Getting started with JDBC
Node access to Alipay open platform sandbox to achieve payment function
First knowledge of go language
TypeError: set_figure_params() got an unexpected keyword argument ‘figsize‘