Hacking C programing

  • Thread starter Thread starter sightlight
  • Start date Start date
  • Views Views 11,060
  • Replies Replies 96
  • Likes Likes 1
No, C# have its own virtual machine, the .NET
http://msdn.microsoft.com/en-us/library/z1zx9t92.aspx

The code is executed in CLR. ;)

Java's JIT nowadays, (like Dolphin and the faster branch of Desmume, if that says anything for speed compared to normal C++).
No matter how you slice the cake, native machine code executes faster than compiling machine code on-the-fly, it's physically impossible to match the performance. Now, this doesn't mean that it's slow, it's just slower, which is something to be kept in mind on older or low-end devices, especially portable ones. On the PC? Not so much.
 
  • Like
Reactions: RodrigoDavy
No matter how you slice the cake, native machine code executes faster than compiling machine code on-the-fly, it's physically impossible to match the performance. Now, this doesn't mean that it's slow, it's just slower, which is something to be kept in mind on older or low-end devices, especially portable ones. On the PC? Not so much.

That's not necessarily true. When you compile to native machine code, only general optimisations can be made so that the application will run decently on the majority of machines. If you're targetting one single device on the other hand, then yes, native code would definitely be much faster because you can make optimisations specifically for that machine.

Java and C# on the other hand, one of the first optimisations they do is make assumptions about your code especially since pointers and whatnot aren't present, and after that, dynamic optimisations can be made through analyse and profiling of your code and the device you're running the code on. Java could for example heavily optimise a particular method that's being executed over and over. In which case, it's perfectly possible for the Java variation of a method to be far faster than the C++ variation that's only generally optimised.

So really, there are several factors that determine whether or not native code is slower or faster.
 
.NET stuff reliably compiles to the same bytecode per-function (given the same .NET version installed) each run, but it's loaded on-demand (so the exact structure differs per run) which may be where some of the confusion comes from.

That reminds me to post my finished Terraria trainer here, after confirming it works with whatever .NET Micrisoft has most recently fed me...

No matter how you slice the cake, native machine code executes faster than compiling machine code on-the-fly, it's physically impossible to match the performance. Now, this doesn't mean that it's slow, it's just slower, which is something to be kept in mind on older or low-end devices, especially portable ones. On the PC? Not so much.
Welllll C++ doesn't compile right to machine code either. The stuff it compiles to needs to be translated to machine code when it's executed.

There are JIT compilers/libraries for C++ though, since the benefits of JIT are becoming more and more recognized.

https://developer.mozilla.org/en-US/docs/Nanojit
http://code.google.com/p/asmjit/
http://homepage1.nifty.com/herumi/soft/xbyak_e.html
(Just links grabbed off wikipedia.)
 
So no efficient Language has the ability to edit code as I write it?

Lua is the most convinient?
In every language, you can test it after any changes you've made.

However you won't get any sort of graphical live preview of level design or anything like that in a language like C++, you need to run the program to test it after you edit+compile it.

While with something like Lua the editing process is simpler, it's the same sort of thing.
 
  • Like
Reactions: ct_bolt
I have choosen C++. Im learning it thanks to thenewboston. Now i wonder if there is anykind of tool or game that will help you learn c++ programing faster.

to practice..

hoping I can compile c++ for the nintendo 3ds
 
I have choosen C++. Im learning it thanks to thenewboston. Now i wonder if there is anykind of tool or game that will help you learn c++ programing faster.

to practice..

hoping I can compile c++ for the nintendo 3ds

It's far easier to learn a language just by typing some code in your IDE. The purpose of the IDE is to make programming in various languages easier and faster. They help you by providing hints and debuggers and overall to give you a better understanding of problems that may occur in your code.

Start by writing the following application, and trying to understand it as much as you can:

Code:
#include <iostream>
 
using namespace std;
 
int main()
{
    cout << "Hello World!";
    return 0;
}

Once you understand that, modify it, try introduce variables and various control structures, and just play around with different language features as much as you can.
 
Does C or C++ have a default graphhics and sound funtions?
Not really, but that's where libraries come in. SDL is one library used commonly for PCs, as for programming for consoles you'd use other libraries. For example for the DS NightFox made libraries with easy functions for sprites/graphics to make games with.

Of course, we have no clue what's going to be developed like that for the 3DS yet.
 

Site & Scene News

Popular threads in this forum