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

Pages: 1-4041-

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

Name: Anonymous 2012-09-27 15:20

nobody has even mentioned V8 :<

Name: Anonymous 2012-09-27 15:34

>>35
Modern smart phones are all written in C and have *nix at their core.

>>36
platform = SDK

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

Name: Anonymous 2012-09-27 15:38

>>42
iOS is not *nix

Name: Anonymous 2012-09-27 15:42

http://en.wikipedia.org/wiki/Mobile_operating_system

not everything is android, and it's nothing new

Name: Anonymous 2012-09-27 15:48

>>5
/polecat kebabs/

Name: Anonymous 2012-09-27 15:58

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

Name: Anonymous 2012-09-27 16:11

>>26
what the fuck is implying and why are you quoting something that wasn't said

get your ass back to reddit onegai

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

>>29

Yes you can run it on your phone, you just need to find a fucking compiler for your phone.

Name: Anonymous 2012-09-27 16:59

>>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: Anonymous 2012-09-27 17:10

Java can be faster than C, but it does so at the (extreme) cost of size.

Name: Anonymous 2012-09-27 17:25

>>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: Anonymous 2012-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: Anonymous 2012-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: Anonymous 2012-09-27 17:55

Just write a C compiler in Java, bam, there you go.

Name: Anonymous 2012-09-27 18:25

>>55
It would have to be an interpreter, or we're just back to square 1

Name: Anonymous 2012-09-27 20:47

/prog/ - Finding new ways to bring C to Android

Name: Anonymous 2012-09-27 21:05

>>56
What if we made a JIT compiler for C in Java?

That would be effectively what the Java Virtual Machine is, except it's in reverse. Written in C that JITs java bytecode.

Name: Anonymous 2012-09-27 21:18

>>58
>JIT compiler

Name: Anonymous 2012-09-27 21:42

>>59
Sure, but how many phones have a shell with STOUT redirection?

Name: Anonymous 2012-09-27 22:05

>>60

All android's when rooted

Name: Anonymous 2012-09-27 22:10

>>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: Anonymous 2012-09-27 22:16

Can Java be faster than C?
yes
Can C be faster than Java?
yes


all of you go back to /g/.

Name: Anonymous 2012-09-27 22:32

>>61
s/ when rooted//

Name: Anonymous 2012-09-27 23:15

>>62
That was pretty good

Name: Anonymous 2012-09-28 0:19

>>39
>Not running the all new and better kind of C

Name: Anonymous 2012-09-28 0:48

>>66
Back to /g/

Name: Anonymous 2012-09-28 1:34

Name: Anonymous 2013-12-01 17:21

%░████▀▀▒▒▒▒▒░░░░▄▄▄▄▒▒▒▀▀███████░░
%░░██▒▒▄▄▒░░░░▒▒▀▒▒▒▒▒▒▒▒▒▒▒▒▀▀██▌░
%░░█▌▄▀▀▒▒▒▒▒▒▒▒▒▄▄▄▄▄▒▒▒▒▒▒▒▌▐▒█▐░
%░░▀▌▒▒▒▄▄▄▒▒▒▒▒▀▄▄█▀▒▒░▒▒▒▒▒▐▒▐▒█░
%░░░▐▒▄▀██▄▀▒▒▒▒▒▒▒░░░░▒▒▒▒▒▒▒▌▌▒█░
%░░░▐▒▒▒▒▒▒▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▌▄▀█░
%░░░▐▒▒▒▒▒▒▌▒▒▒▒▀▄░░░▒▒▒▒▒▒▒▒▒▌▐██░
%░░░░▌▒▒▒▒▐▒▒▒▒▄▄▀░░░░▒▒▒▒▒▒▒▒▒▌▒█░
%░░░░▐▒▒▒▒▒▀▀▒▀▒▄▄▄▄░▒▒▒▒▒▒▒▒▒░███░
%░░░░░▌▒▒▒▄█▀▀▀▀▀▀▀▀█▒▒▒▒▒▒▒▒░▀▐██░
%░░░░░▐▒▒▒█▒▀████▀▀▒▐▌▒▒▒▒▒░▄▒▒▐░░░
%░░░░░░▐▒▒▀▒▒▒▒▒▒▒▒▒▒▐▒▒▒▒▄▒▒▒▄▐░░░
%░░░░░░▀▌▒▐▌▐▌▀▌▀▌▀▌▀▌▐▀▀▌▒▐▐▌▌▌▌░░
%░░░░░░░█▒▐▒▐▌▒▌▄▌▐▌▄▒▐▌▄▌▒█▌█▒▒▐░░
%░░░░░░░▐▌▌▒▐▌▒▌▒▒▐▌▒▄▐▌▀▄▒▒▒▒▒▒▒▀▄
%░░░░░░░░▀▒▐▀▀▒▀▒▒▀▀▀▀▒▀▒▀▀▒▒▒▒▒▒▒
%YOU'LL COWARDS DON'T EVEN SMOKE CRACK
%POST lN 3 THREADS OR YOU'LL COWARD

Name: Anonymous 2013-12-02 0:29

**YOU HAVE BEEN VISITED BY LE TOP LEL OF COMEDY GOLD** POST THIS IS 3 threads or lose your sides!
░░░░░░░▄▀▀▀░▄▄▄▄░░░▀▀▀▀▀▀▀▀▄▄░▀
░░░░░░░█░░░░░░░░▀▀▀▀▀▄▄▄▄▄▄▄▄▀░░█
░░░░░▄▀░░░░░░░░░░▄░░░░░░░░▄▄░░░░░▀▄
░░░▄▀░░░░░▄▀▀▀█▄░▀░░░░▄▀▀▀██▀▀▄░░░░░▀
░░▄▀░░▄▄░░▀▀▀▀████▀░░░▀▄▄▀▀▀▀▄█░░░░░░█
░▄▀░▄▀█░░▄▄░░░░░░░█░░░░░▄▄▄░░░▀▀░░░░░░█
▄▀░░█░█░▀░░▀▀▄░░░░░█░░░░░░░▀▀▀▀▀▄░░░░░█
▀▄░░▀░█░░░▄░░░░░░▄▀░░░░▀▄░░░▄▄░░▀▄░█░▄▀
░░▀▄░░░░█▀▄░░░░░▀█░░░░▀▀░█▄▀▄░█░░░█░█
░░░░█░░█░▀▄▀▄▄░░░░▀▀▀░░░▄█▀░▄▀█░░░░▄
░░░░░█░░█░▀▀▄░▀▄▄▄▄▄▄▄▀█░▄█▀▄▀░░░░░
░░░░░█░░▀▄▄░░▀█░░░█░░▄▄▀▀▄▄█▀░░░░▀
░░░░▄▀░░░▀▄▀▀▄░▀▀▀▀▀▀▄▄▀▀▀▄▀░░░░▀
░░░▄▀░░░░░░▀▄░█▄▄▄▄▀▀░▀▄▀▀░░░▄▀▀
░░▄▀░░░░░░░░░▀▄▄▄▄█▄▄▀▀░░░░▄
░░█░░░░░░▀▄▄░░░▄▄▄▄▄▄▀░░░▄▀
░░█░░░░░░░░░▀▀▀▄▄▄▄▄▄▄▀▀
░░░█░░░░░░▀▀▀▀▀░░░░▄
░░░▀▀▄▄▄▄▄▄▄▄▄▀▀▀

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