What is the Base Class Library?
If I understand this correctly, the CIL does not have instructions for performing syscalls, therefore all of the syscalls are done through call instructions into native implementations. Then it follows that all of these implementations are a part of the dotnet runtime. If this is true, what exactly is the BCL and why does it come with the dotnet SDK but not with the runtime?
12 Replies
the BCL does come with the runtime
it's the set of libraries that come "out of the box"
okay so the BCL refers to the native implementations of the .NET standard APIs?
wdym "native"?
it's just all the libraries you get to use without going to nuget or whatever
like all those types under System.*
if I install a runtime for windows x86, I'd need a native implementation for
System.Console.WriteLine
for instance since you can't write one with CIL?for calling into the OS, there's p/invoke
some of those p/invokes go into the runtime, but others call OS APIs directly
WriteLine just writes to Console.Out, which is a TextWriter
the BCL is written in C#
some of that might make P/Invoke calls, or calls into the runtime
okay I'm kind of getting it
one thing tho
I get the BCL as a compiled IL right?
yes
with both the runtime and the SDK?
and then my compiled code is just calls to the BCL?
ish
the runtime ships with the full BCL
the SDK just has reference assemblies (metadata only, no "real code") that you compile against
(but when you install the SDK you also install the runtime)
right the sdk just has the interfaces? '
Reference assemblies - .NET
Learn about reference assemblies, a special type of assemblies in .NET that contain only the library's public API surface
this question may actually be better in #advanced tbh