Common Language Runtime observations

Excellent, I’ve just read as much as I want to read around Common Language Runtime for the time being. I learned a few interesting bits and pieces:

Firstly, assemblies can be compiled ahead of time (rather than interpreted at runtime, just-in-time fashion). However, there are massive limitations to using this, such as one cannot use virtual functions (which I use everywhere as one should in OOP). So, to compile-ahead may only apply to certain code assemblies. Re-architecting could make more code more compile-ahead friendly but the overhead of doing this might not be worthwhile.

Secondly, I am not about to confuse bytecode with assembler here; however, the CIL mode of execution is different to how say an assembly language like 6510 works. Here is a CIL example to add two locations together:

ldloc.0
ldloc.1
add
stloc.0 // a = a + b or a += b;

Here is a 6510 example to do the same thing:

lda $1000
clc
adc $1001
sta $1000
// a = a + b or a += b;

In short, each line of code in 6510 has a greater degree of autonomy than with CIL.With CIL the previous lines of code matter in that these are used as parameters for the add instruction, despite that it is not explicitly intuitive to the reader from its notation.