当前位置:网站首页>. 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
边栏推荐
- Detailed explanation of Niuke - Gloves
- Detailed explanation of the penetration of network security in the shooting range
- First knowledge of go language
- Go language, array, string, slice
- 1-2 JSX syntax rules
- Preliminary understanding of promse
- On lambda powertools typescript
- Log4j output log information to file
- 1-4 configuration executable script of nodejs installation
- [pimf] openharmony paper Club - what is the experience of wandering in ACM survey
猜你喜欢
Get the column name list of the table quickly in Oracle
PyMySQL
How to choose the wireless gooseneck anchor microphone and handheld microphone scheme
Dancenn: overview of byte self-developed 100 billion scale file metadata storage system
Scope and scope chain in JS
【WPF绑定3】 ListView基础绑定和数据模板绑定
[pimf] openharmony paper Club - what is the experience of wandering in ACM survey
Detailed explanation of information abstract, digital signature, digital certificate, symmetric encryption and asymmetric encryption
Nifi fast installation and file synchronization
Go language, array, string, slice
随机推荐
Detailed explanation of information abstract, digital signature, digital certificate, symmetric encryption and asymmetric encryption
1-3 nodejs installation list configuration and project environment
STM32__ 03 - beginner timer
Mock test using postman
Change the password after installing MySQL in Linux
How much do you know about the process of the interview
面试百分百问到的进程,你究竟了解多少
自定义my_strcpy与库strcpy【模拟实现字符串相关函数】
计算饼状图百分比
【PIMF】OpenHarmony啃论文俱乐部—在ACM Survey闲逛是什么体验
Go language RPC communication
Talk about browser cache control
MySQL master-slave replication
1-2 characteristics of nodejs
Linux MySQL data timing dump
[problem solving] [show2012] random tree
freeCodeCamp----prob_ Calculator exercise
Customize my_ Strcpy and library strcpy [analog implementation of string related functions]
Detailed explanation of the penetration of network security in the shooting range
博士申请 | 厦门大学信息学院郭诗辉老师团队招收全奖博士/博后/实习生