C
C#11mo ago
Jaynix

Are there multiple types of compiled code? Can I get a simplified explanation of what it is?

I got confused when I read "intermediate language binary instruction" when reading the definition of Common intermediate Language. My view of compiled code in my head is exclusively it being binary. I don't think there are other types of compiled code, I thought (and please correct me if im wrong) compiled code is the most simplified version of code with the purpose of being able to be read by the machine, and when code gets compiled, it turns into binary. Are there different types of compiled code?
11 Replies
footballjoe789
footballjoe78911mo ago
Are there different types of compiled code?
Yes. An app compiled to run on x86-64 cannot run on a ARM-based device without emulation at a software level.
Jaynix
JaynixOP11mo ago
so different types of compiled code serve the purpose of making apps run on more systems or are made for different systems
footballjoe789
footballjoe78911mo ago
Have you looked into the history of Java and why that programing language was a game changer in the 90s?
Jaynix
JaynixOP11mo ago
no revolutionized the IT undustry
footballjoe789
footballjoe78911mo ago
So in Java, the Java script(s) are compiled to a Java Intermediate Language (JIL), which can be interpreted by a Java Runtime Environment (JRE) that is built for a specific processor architecture. And if you want to build a java app that doesn't need a JRE installed to work, it can be compiled to that OS's app structure. CIL in .NET follows a similar structure. Which is why code obfuscation is a must for comercial C# apps.
Jaynix
JaynixOP11mo ago
i thought maching code was binary like the 1s and 0s were like basic switches on and off
footballjoe789
footballjoe78911mo ago
Have you looked into how assembly code works?
Jaynix
JaynixOP11mo ago
is assembly code a synonym to machine code just looked it up and results were useless what makes them different? mainly i found a goldmine of information
footballjoe789
footballjoe78911mo ago
(only complaint is that C is a lower level language)
Jaynix
JaynixOP11mo ago
ah ok
Дядя Женя
@Jaynix C# does not compile into any kind of "machine language", it almost literally copy-pastes your C# code into .exe or .DLL. You can see what your C# program has compiled by downloading dnSpy and opening any .exe or .dll made in C#. It is IL instructions which are interpreted easily back to C#. When your program runs it will, let's say "compile it into machine code in runtime", can I say that ? yeah, but it kinda gives you an idea not truly an expect of super-low-level stuff myself, but trying to answer your general question: every program you create in some way ends up being a list of assembly instructions that are given to your OS to interpret further to run commands on your CPU. Some programming languages, often referred to as low-level programming languages are compiled directly into those assembly instructions. Other languages do it other ways. Some are compiling themselves into one of those low-level languages that are then compiled into assembly, some, like javascrtipt, are interpreted in runtime by other programs just trying to give the author general idea of what's happening. @univershal SyncRооtcorrect me if i'm completely wrong
Want results from more Discord servers?
Add your server