C
C#5mo ago
NorwayFish

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
jcotton42
jcotton425mo ago
the BCL does come with the runtime it's the set of libraries that come "out of the box"
NorwayFish
NorwayFish5mo ago
okay so the BCL refers to the native implementations of the .NET standard APIs?
jcotton42
jcotton425mo ago
wdym "native"? it's just all the libraries you get to use without going to nuget or whatever like all those types under System.*
NorwayFish
NorwayFish5mo ago
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?
jcotton42
jcotton425mo ago
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
NorwayFish
NorwayFish5mo ago
okay I'm kind of getting it one thing tho I get the BCL as a compiled IL right?
jcotton42
jcotton425mo ago
yes
NorwayFish
NorwayFish5mo ago
with both the runtime and the SDK? and then my compiled code is just calls to the BCL?
jcotton42
jcotton425mo ago
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)
NorwayFish
NorwayFish5mo ago
right the sdk just has the interfaces? '
jcotton42
jcotton425mo ago
Reference assemblies - .NET
Learn about reference assemblies, a special type of assemblies in .NET that contain only the library's public API surface
jcotton42
jcotton425mo ago
this question may actually be better in #advanced tbh
Want results from more Discord servers?
Add your server