Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
WillLTT

Does C#, c++ etc compile the same exe file structure wise?

25 minutes ago, WillLTT said:

Mods if this thread is better in Programming thread then feel free to move it. It just thought it fit here better because im asking about Executeables files that are built into windows. 

I'm not a mod but.... I will allow it.

25 minutes ago, WillLTT said:

Im wondering does c++, c#, java, extra compile to the same exe, in known you need for example 

.NET to run c#, and you need visual c++ framework, etc

Java compiles to its own form of "byte code" that can only run in Java Virtual Machines. That's why Java programs are cross platform.

Sometimes computers need dependancies-hence the C++ redistributables you may attain from downloading games on Steam.

25 minutes ago, WillLTT said:

But do all these compile to the same exe insides? Like are they simmilarly structured, compiled to the same exe internaly. 

 

Feel free to correct any missspellings or miss wording, im trying to learn this better.

Not all compilers compile the same language the same way.

I don't know that a single compiler compiles 2 seperate languages the same way.
C# is also compiled into a type of byte code as it was Microsoft's attempt at a cross platform technology like Java.

Recommended Posts

Posted · Original PosterOP

Mods if this thread is better in Programming thread then feel free to move it. It just thought it fit here better because im asking about Executeables files that are built into windows. 

 

Im wondering does c++, c#, java, extra compile to the same exe, in known you need for example 

.NET to run c#, and you need visual c++ framework, etc

 

But do all these compile to the same exe insides? Like are they simmilarly structured, compiled to the same exe internaly. 

 

Feel free to correct any missspellings or miss wording, im trying to learn this better.

Link to post
Share on other sites

I dont think so, compilers are optimized to convert your code to assembly in different ways for different programming languages (there is also different compiler defaults, settings, flags). Structure is in assembly level should be somewhat similiar but dont quote me on that, I only have very basic knowledge of asm.


y'all need to poop more often.

Link to post
Share on other sites
Posted · Original PosterOP
1 minute ago, Levent said:

--snip--

I have little to none knowledge at assembly at all. But if they all end up with assembly would'nt that mean that they would HAVE to be simmilar for windows to be able to use them independently? (with the frameworks installed & etc)

Link to post
Share on other sites
5 minutes ago, WillLTT said:

Mods if this thread is better in Programming thread then feel free to move it. It just thought it fit here better because im asking about Executeables files that are built into windows. 

 

Im wondering does c++, c#, java, extra compile to the same exe, in known you need for example 

.NET to run c#, and you need visual c++ framework, etc

 

But do all these compile to the same exe insides? Like are they simmilarly structured, compiled to the same exe internaly. 

 

Feel free to correct any missspellings or miss wording, im trying to learn this better.

1. A compiler converts from programming language to machine cpu (lets say x86 or arm7) or VM (.net runtime, or java) instructions.

2. A linker (in case of cpu) will link the comoiled result into a package (exe, dll etc) where the binary format depends on the target environment like operatimg system. So the exact formatting of content willmcary between linux, windows etc. This is also where cross-library symbols will be resolved. For vm types (.net runtime, java virtual machine), this is done on a more runtime basis instead of a "pre-existance link" step.

Link to post
Share on other sites
Posted · Best Answer
25 minutes ago, WillLTT said:

Mods if this thread is better in Programming thread then feel free to move it. It just thought it fit here better because im asking about Executeables files that are built into windows. 

I'm not a mod but.... I will allow it.

25 minutes ago, WillLTT said:

Im wondering does c++, c#, java, extra compile to the same exe, in known you need for example 

.NET to run c#, and you need visual c++ framework, etc

Java compiles to its own form of "byte code" that can only run in Java Virtual Machines. That's why Java programs are cross platform.

Sometimes computers need dependancies-hence the C++ redistributables you may attain from downloading games on Steam.

25 minutes ago, WillLTT said:

But do all these compile to the same exe insides? Like are they simmilarly structured, compiled to the same exe internaly. 

 

Feel free to correct any missspellings or miss wording, im trying to learn this better.

Not all compilers compile the same language the same way.

I don't know that a single compiler compiles 2 seperate languages the same way.
C# is also compiled into a type of byte code as it was Microsoft's attempt at a cross platform technology like Java.


LTT Fan Fiction:

 

PC game list: 

 

Link to post
Share on other sites

Here is something you might want to take a look at. It gives you an idea of what goes where for a program to execute. It's a rabbit hole.....but it's a well documented rabbit hole!

 

https://en.wikipedia.org/wiki/Executable_and_Linkable_Format


The computer isn't the "Thing".....the computer is the "Thing" that gets you to the "Thing".  - excerpt from "Halt and Catch Fire".

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×