当前位置:网站首页>. 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
边栏推荐
- ◰GL-阴影贴图核心步骤
- 【WPF绑定3】 ListView基础绑定和数据模板绑定
- How to implement distributed locks with redis?
- 拷贝构造函数 浅拷贝与深拷贝
- Milvus 2.0 质量保障系统详解
- [pimf] openharmony paper Club - what is the experience of wandering in ACM survey
- SPC introduction
- _ Mold_ Board_
- New keyword learning and summary
- Bytevcharts visual chart library, I have everything you want
猜你喜欢
Getting started with JDBC
网络安全之渗透靶场实战详解
扫码登录的原理你真的了解吗?
How to build tiktok user trust and drive fan growth
信息摘要、数字签名、数字证书、对称加密与非对称加密详解
Dancenn: overview of byte self-developed 100 billion scale file metadata storage system
Feign report 400 processing
Bottom processing of stack memory in browser
Get the column name list of the table quickly in Oracle
Shell script -- shell programming specification and variables
随机推荐
Getting started with JDBC
Quick install mongodb
Error in v-on handler: "typeerror: cannot read property 'resetfields' of undefined"
Read a blog, re understand closures and tidy up
SQL: How to parse Microsoft Transact-SQL Statements in C# and to match the column aliases of a view
Paging the list collection
ByteVCharts可视化图表库,你想要的我都有
Path environment variable
[markdown notes]
Milvus 2.0 détails du système d'assurance de la qualité
博士申请 | 厦门大学信息学院郭诗辉老师团队招收全奖博士/博后/实习生
AIOT产业技术全景结构-数字化架构设计(8)
Detailed explanation of information abstract, digital signature, digital certificate, symmetric encryption and asymmetric encryption
Bytevcharts visual chart library, I have everything you want
1-3 nodejs installation list configuration and project environment
计算饼状图百分比
Bottom processing of stack memory in browser
How vscode compares the similarities and differences between two files
True math problems in 1959 college entrance examination
批量制造测试数据的思路,附源码