>>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.
>>39
By bootstrap code I mean the minimal amount of reusable code needed to start developing a given type of program. A programming template if you will.
>>43
It's based on Darwin, which meets the SUS. Apple only bought the UNIX® license for OS X, though: http://www.opengroup.org/openbrand/register/
Why they haven't for iOS is beyond me. It's certainly a Unix, and definitely a ``*nix''.
>>26
what the fuck is implying and why are you quoting something that wasn't said
get your ass back to reddit onegai
Name:
Anonymous2012-09-27 16:41
>>43
If you compile a few extra POSIX utils, most of which are written in C, it's close enough.
Name:
Anonymous2012-09-27 16:48
While some Java code may be written in a way that will be faster than some equivalent code made in C, such cases are rare, and always stem from the equivalent C being less optimized. C by nature must always be faster given that Java does not translate to a one to one set of instructions for the CPU, and must always be run in an interpreter, which is written in C.
>>46
Darwin doesn't have a SUS-compliant vi. The fact that it's certified in spite of this obvious deficiency shows that the Open Group doesn't give a shit about the UNIX brand, and will sell certification to anyone who pays them enough.
Name:
Anonymous2012-09-27 17:10
Java can be faster than C, but it does so at the (extreme) cost of size.
>>28 >>47
What I wanted to say was that C was never meant to be fast. At least not as the main selling point. A C implementation might be fucking slow and still expose it's (real) main features of being a language that can do low-level-ish tasks without having to include some sort of assembler.
Name:
Anonymous2012-09-27 17:45
There exists a C compilet that can compile code for any cell phone out there, but you'll never have access to it since it's top secret proprietary software and the phone company isn't becoming any less jewish
Name:
Anonymous2012-09-27 17:49
>>53
You compile for the architecture, not for the operating system/sys call layer/API.
But yes the phone market is very locked down, even from a physical point it is usually hard to tinker with the machines, and programming without libraries is not for everyone.
Name:
Anonymous2012-09-27 17:55
Just write a C compiler in Java, bam, there you go.
>>60
I'm a little program, short and STOUT,
Here is my HANDLE,
Here is my spout,
When I get all redirected,
Hear me shout,
Tip me up and Segmentation fault.
Name:
Anonymous2012-09-27 22:16
Can Java be faster than C?
yes Can C be faster than Java?
yes
**YOU HAVE BEEN VISITED BY LE TOP LEL OF COMEDY GOLD** POST THIS IS 3 threads or lose your sides!
░░░░░░░▄▀▀▀░▄▄▄▄░░░▀▀▀▀▀▀▀▀▄▄░▀
░░░░░░░█░░░░░░░░▀▀▀▀▀▄▄▄▄▄▄▄▄▀░░█
░░░░░▄▀░░░░░░░░░░▄░░░░░░░░▄▄░░░░░▀▄
░░░▄▀░░░░░▄▀▀▀█▄░▀░░░░▄▀▀▀██▀▀▄░░░░░▀
░░▄▀░░▄▄░░▀▀▀▀████▀░░░▀▄▄▀▀▀▀▄█░░░░░░█
░▄▀░▄▀█░░▄▄░░░░░░░█░░░░░▄▄▄░░░▀▀░░░░░░█
▄▀░░█░█░▀░░▀▀▄░░░░░█░░░░░░░▀▀▀▀▀▄░░░░░█
▀▄░░▀░█░░░▄░░░░░░▄▀░░░░▀▄░░░▄▄░░▀▄░█░▄▀
░░▀▄░░░░█▀▄░░░░░▀█░░░░▀▀░█▄▀▄░█░░░█░█
░░░░█░░█░▀▄▀▄▄░░░░▀▀▀░░░▄█▀░▄▀█░░░░▄
░░░░░█░░█░▀▀▄░▀▄▄▄▄▄▄▄▀█░▄█▀▄▀░░░░░
░░░░░█░░▀▄▄░░▀█░░░█░░▄▄▀▀▄▄█▀░░░░▀
░░░░▄▀░░░▀▄▀▀▄░▀▀▀▀▀▀▄▄▀▀▀▄▀░░░░▀
░░░▄▀░░░░░░▀▄░█▄▄▄▄▀▀░▀▄▀▀░░░▄▀▀
░░▄▀░░░░░░░░░▀▄▄▄▄█▄▄▀▀░░░░▄
░░█░░░░░░▀▄▄░░░▄▄▄▄▄▄▀░░░▄▀
░░█░░░░░░░░░▀▀▀▄▄▄▄▄▄▄▀▀
░░░█░░░░░░▀▀▀▀▀░░░░▄
░░░▀▀▄▄▄▄▄▄▄▄▄▀▀▀