Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can Java be faster than C?

Name: Anonymous 2012-09-27 11:54

Can Java be faster than C?

Name: Anonymous 2012-09-27 11:55

First and foremost, Java's focus is portability, not speed.

Name: Anonymous 2012-09-27 11:58

Yes, if the C programmer is mentally retarded.

Name: Anonymous 2012-09-27 12:02

Or the compiler is quite bad.

Name: Anonymous 2012-09-27 12:03

>>2
Implying C is not the most portable language of all time

Name: Anonymous 2012-09-27 12:03

Java contains caffeine, which is a stimulant. C is just a letter.
Java is obviously faster than a mere letter in the alphabet.

Thread over.

Name: Anonymous 2012-09-27 12:15

>>1
GC is faster than mallocs/reference-counting/skip-lists, which you'll have to do in C/C++.

Name: Anonymous 2012-09-27 12:16

Yes, with Jazelle.

Name: Anonymous 2012-09-27 12:16

no, but javascript is

Name: Anonymous 2012-09-27 12:16

>>7
IHBT, or you sincerely believe garbage collection is some kind of voodoo.

Name: Anonymous 2012-09-27 12:16

>>6
c is the speed of light in a vacuum, much faster than coffee.

Name: Anonymous 2012-09-27 12:18

>>7
u wot m8? u chky bstrd cok facd mongrl

knowing where the memory is and reusing it without malloc/free or GC is still best, and malloc/free is still faster than GC

proof: serious workload doesn't use GC

Name: Anonymous 2012-09-27 12:21

JVM's allocation methods are better implemented and use less lines of code than C's malloc.

Deal with it.

Name: Anonymous 2012-09-27 12:24

>>2
JVM is written in C/C++; therefore, to make a portable JVM they need to have a standard implementation of C/C++ on the platform.



Thus C/C++ is just as portable as Java

Name: Anonymous 2012-09-27 12:25

>>14
Portable means you can run it on Windows, Mac and Linux, idiot.

Name: Anonymous 2012-09-27 12:27

>>15
Portable as in source, you numbskull.

Name: Anonymous 2012-09-27 12:28

>>13
>>13

1/10
come on son

Name: Anonymous 2012-09-27 12:36

>>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.

Name: Anonymous 2012-09-27 12:41

>>15
C can run on all of those, your point?

Name: Anonymous 2012-09-27 12:44

>>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?

Name: Anonymous 2012-09-27 12:46

>>18
you can't write in C for them

So the JVM just magically appeared on them?

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?

Name: Anonymous 2012-09-27 13:05

>>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: Anonymous 2012-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: Anonymous 2012-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.

Name: Anonymous 2012-09-27 13:14

>>22
My toaster does have a CPU

Name: Anonymous 2012-09-27 13:27

>>2
Implying C's focus is speed.

Name: Anonymous 2012-09-27 13:29

Java is a beautiful language whose magnificence can't be grasped by donkeys like you, being serious here.

Name: Anonymous 2012-09-27 13:54

>>26
What is it?

Name: Anonymous 2012-09-27 13:59

>>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.

Name: Anonymous 2012-09-27 14:22

>>22
you can't run C programs on those phones
the program still runs
are you fucking deaf

Name: Anonymous 2012-09-27 14:23

Java is truly portable.

Name: Anonymous 2012-09-27 14:30

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.

Name: Anonymous 2012-09-27 14:31

>>29
WHBTC

Name: Anonymous 2012-09-27 14:31

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.

Name: Anonymous 2012-09-27 14:38

>>34
Shut up goy, phones can't run C

Name: Anonymous 2012-09-27 14:55

>>34
platform's native language
What

Name: Anonymous 2012-09-27 15:09

Name: Anonymous 2012-09-27 15:15

>>32
not true

>>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.

>>35
or [i]can they?[/]

>>37
generic bullshit

Name: Anonymous 2012-09-27 15:16

My phone runs C
How does it run?
Faster and more stable than java

Name: Anonymous 2012-09-27 15:17

>>37
Is that even relevant, or just your way of saying ``I read Wikipedia''?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List