C++ turning "APP.QUIT()" (a string) into actual code

Started by
12 comments, last by Antheus 12 years, 1 month ago

Oh, i forgot java/c# gets interpreted and c++ is an executeable.

The distinction isn't all that useful, both Java and C# VMs run mostly native code, same as C++ binary. They just defer the compilation until code runs. And even then it's possible to force most compilation upfront.

On Android, Java is statically compiled, exactly the same way as C++.

On most modern x86 CPUs even native code is "interpreted", at very least the instructions that CPU executes are defined via microcode rather than being implemented directly.

Didnt knew that biggrin.png Is there no way to do this?[/quote]

Of course there is, it's just a bit of work. Structure data must either be manually defined or somehow generated by compiler or some other tool.

C++ doesn't offer reflection out-of-box due to optimization. A compiler is free to remove anything it deems redundant, including structures and functions. Full reflection would require preserving even unused parts. Templates in particular cause unacceptable overhead without such optimization.
Advertisement

[quote name='IceBreaker23' timestamp='1329749816' post='4914819']
Oh, i forgot java/c# gets interpreted and c++ is an executeable.

The distinction isn't all that useful, both Java and C# VMs run mostly native code, same as C++ binary. They just defer the compilation until code runs. And even then it's possible to force most compilation upfront.

On Android, Java is statically compiled, exactly the same way as C++.

On most modern x86 CPUs even native code is "interpreted", at very least the instructions that CPU executes are defined via microcode rather than being implemented directly.

Didnt knew that biggrin.png Is there no way to do this?[/quote]

Of course there is, it's just a bit of work. Structure data must either be manually defined or somehow generated by compiler or some other tool.

C++ doesn't offer reflection out-of-box due to optimization. A compiler is free to remove anything it deems redundant, including structures and functions. Full reflection would require preserving even unused parts. Templates in particular cause unacceptable overhead without such optimization.
[/quote]

Really usefull knowledge :D
Thank you.
On Android, Java is statically compiled, exactly the same way as C++.

What do you mean "exactly the same way as C++" ? On Android Java is compiled exactly same as for desktop - to bytecode. During runtime bytecodes gets interpreted and hotspots are JITed to native machine code. So that is not exactly same as C++, which gets compiled completely to machine code on development host.

[quote name='Antheus' timestamp='1329751108' post='4914826']On Android, Java is statically compiled, exactly the same way as C++.

What do you mean "exactly the same way as C++" ? On Android Java is compiled exactly same as for desktop - to bytecode. During runtime bytecodes gets interpreted and hotspots are JITed to native machine code. So that is not exactly same as C++, which gets compiled completely to machine code on development host.
[/quote]
My bad, I was thinking of something else.

This topic is closed to new replies.

Advertisement