How to compile C ++ / C # / java?

I am trying to understand how these languages ​​work under the hood. Unfortunately, I only ever read very superficial things. I will summarize what I know, I would be very happy if you could correct me, and, above all, help me improve my little knowledge for half a century.

C ++:

The C ++ compiler processes all source files. This means that it actually inserts lines into the places where the macros were originally. After that, it creates a .obj file for each source file containing independent machine bytecode. The linker then associates all external .obj files from the libraries with arbitrary .obj files and compiles them into a .exe file.

Java:

The Java code is compiled into a machine-independent "byte code", which is in the .class files, which, in turn, can be in the .JAR files that run on the JRE. Then the virtual machine just does the garbage cleaning. Java code compiles right on time, such as C #, but with a hot spot optimization developed by SUN.

WITH#:

Almost the same as Java? The C # source code is compiled into CIL (Common Intermediate Language) code, which is still accessible to humans. This code will be run by the CLR Just-in-Time. This compilation turns methods into machine code only on the first call.

Actually, almost every language interests me ... but Java and C # are almost the same, and I always wondered how to differentiate. And C ++ is “classic,” so to speak. The father of both without any virtual machine. Appreciate the help!

edit: , , . , , . / SUN Java, .

+3
3

++ ++, # Java.

++

++ ( "" ++) . , ( ), , . , . , , ( yadda yadda).

++, # Java

(CIL .NET, #, - Java Java). , . - . Just-in-Time, . , JIT. ( JITting ), JITting.

, , , , , , ( JIT-).

+6

.

++.obj , , , . Linker .obj .

, - , . VM , . , , - - JIT Compiling.

, , , # CIL .

+1

( OO-), ,

  • Java # (.. , ), ++
  • Java # ( , undefined );
  • ++ NULL- ( ), # Java ;
  • # Java ( , / ) ..
  • ++ , # Java (IL JVM) JITting . IL JVM , , "CPU".

++ , , JIT.

0
source

Source: https://habr.com/ru/post/1763694/


All Articles