CLR and CLI - What is the difference?

后端 未结 6 1612
遇见更好的自我
遇见更好的自我 2020-12-04 18:55

I want to know what exactly is the difference between CLR & CLI? From whatever I have read so far, it seems to indicate that CLI is a subset of CLR. But isn\'t everythin

6条回答
  •  既然无缘
    2020-12-04 19:47

    CLR is the execution environment in which a .NET application is safely hosted/run.

    You can see it as .NET's private Operating System that initiates and loads just before a .NET application starts.

    The CLR takes care of certain essential requirements of any .NET application that otherwise would require lot of deliberate code to be written in order to implement; requirements that are holistic in nature and essential to any kind of application to run in a good, efficient and safe manner [e.g. Handle memory allocation and release it when not required, avoid dangling pointers, avoid type-casting errors etc. ]

    CLI on the other hand is a specification/set of guidelines that explains how to implement an application execution environment and the nature of generated application code that allows for multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures.

    CLI is developed by Microsoft and standardized by ISO and ECMA.

    The CLR is a practical implementation of CLI's VES [Virtual Execution System] section and forms one of the core components of the MS.NET platform

    In a layman's language, CLI is a recipe while CLR is the cuisine :-)

提交回复
热议问题