>>16
Java source runs on thousands of phones. You can't run C on those phones. Try to write hello_world.c and get it to run on a Nokia, Samsung or Apple.
>>18
Sure, but seeing as they don't have a console, does it count if I redirect the output to a file and then inspect the contents of that file? Thus showing the program still runs. It won't exhibit the exact same behaviour as ./helloworld on a desktop, but it's in a different environment, so why would it?
If i compile a file that targets X then it's obviously not going to run on all Y where Y are differrnt architectures or systems. But if i had a compiler that could target one of those phones then what do you think is stopping me?
How do you think they get the JVM working on those phones to begin with? Magic?
>>20,21
So you're agreeing with me: you can't run C programs on those phones, but you can run Java programs.
Of course, it's ``possible''. It's also ``possible'' that Minecraft can work on my toaster. Maybe it would run then quit because there's no display, cache, or CPU, but at least it would ``run''!
Name:
Anonymous2012-09-27 13:08
>>11
C++ is 1 unit higher than the speed of light in a vacuum. Therefore, any program written in C++ will begin executing before it is actually run, making it the fastest language in existence.
Name:
Anonymous2012-09-27 13:09
>>22
Er... you can run C programs on those phones...a C program doesn't have a little tag saying it was made in C, it's just a file that needs to be loaded and executed, you might say you lack the proper credentials to run software your Google overlords didn't oversee personally but that's you, don't say any computer can't run a program written in C.
>>24 you might say you lack the proper credentials to run software your Google overlords didn't oversee personally but that's you
Now you're mincing hairs.
If I write a program in C, can I run it on my phone? No.
If I write a program in Java, can I run it on my phone? Yes.
This applies to thousands of models of phones, so overall Java is more portable.
There is certain kinds of code that will run faster on Java than C or C++. I forgot what that was, but there were certain kinds of optimizations that the JVM can make having to do with Jitting and runtime checking that makes the code run faster than C/C++ would be able to do. This is why you cant say that one language is always faster than another, every language has its sweetspot where it will take advantage certain kind of code. This is why benchmarks have to be as general as possible.
C programs can be run on Android and iPhone. Most games on these platforms are written in C or C++ with some bootstrap code in the platform's native language.
The Android SDK is nothing more than a Java interface to the Android API which is language agnostic. It doesn't even compile to JVM bytecode, but has its own VM called Dalvik.
>>34
bootstrap isn't what you think it is; all languages are abstractions, in the end implemented on the architecture machine codes; java programs compiled for android still compile to an intermediate language, even if not meant to run on Oracle's VM.