Hi, I'm trying to understand how these languages work under the hood. Unfortunately I only ever read very superficial things. I'll summarize what I know already, I would be really happy if you could correct me, and most of all, help me enhance my little bits of half-knowledge.
C++:
The C++ compiler preprocesses all source files. This means, that it actually inserts strings into the places where macros where originally. After that, it creates an .obj file for each source file containing machine independant bytecode. The linker then links all external .obj files from libraries with the custom made .obj files together, and compiles it into an .exe.
Java:
Java code is compiled into machine independant "bytecode" which sits in .class files, which in turn can sit in .JAR files, which get run on the JRE. The virtual machine is just doing garbage cleanup then. Java code is compiled just-in-time like C#, but with hotspot optimization developed by SUN.
C#:
Practically the same as Java? C# source code gets compiled into CIL (Common Intermediate Language) code, which is still human readable. This code will be run by the CLR Just-in-Time. This compilation turns methods into machine specific code just when they are first called.
I'm actually interested in pretty much every language...but Java and C# are almost the same, and I always wondered how the differentiate. And C++ is the "classic" so to speak. The father of both without any kind of virtual machine. Appreciate the help!
edit: I know that this is a broad subject, but I really couldn't find any solid knowledge. If you have links or books that explain this sort of thing I'm happy to go to work. I tried to read the SUN specifications/whitepapers for the java virtual machine, but that is all a little too deep for me right now.