Search code examples
c#c++.netfcl

is framework class library(FCL) implemented separately for C# and C++?


I am just beginning with C# . net programming, a book i read states that the FCL has many useful classes for many tasks.

My question is, does it mean that microsoft has created different versions of FCL for different .net compliant languages or, the FCL is written MSIL(microsoft intermediate language) so that only one copy of FCL is needed?


Solution

  • No, there is just one implementation. A strong design goal in .NET was to make the framework implementation available to many languages. Enforced by encoding the content of a .NET assembly, metadata and code, in a language-independent format. Described by the CLI specification, Ecma-335. Every .NET compiler adheres to that standard so code you write in one language can be used by any other .NET language compiler.

    And there's platform independence, achieved by the just-in-time compiler, it converts the MSIL in the assembly to machine code that matches the kind of processor that the machine uses. Not quite as flexible as language independence, this does require a version of the CLR that is capable of executing on the machine's operating system. And some FCL features might not be supported, something like WPF can only be used on Windows.