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

Java vs. brainfuck vs. Python.

Name: Anonymous 2007-04-24 18:38 ID:oUkHXcjW

http://en.wikipedia.org/wiki/Brainfuck
http://en.wikipedia.org/wiki/Java
http://en.wikipedia.org/wiki/Python_%28programming_language%29

Now that we're all up to speed, discuss the pros and cons of each language, as well as which you believe to be the superior language.

Name: Anonymous 2007-05-01 8:50 ID:ZmWZXdsP

$ cat >> count.hs << EOD
* count :: Int -> Int
* count i = if i == 100000000 then i else count (i+1)
*
* main = putStrLn (show (count 0))
* EOD
$ ghc --make count.hs -o count
Chasing modules from: count.hs
Compiling Main             ( count.hs, count.o )
Linking ...
$ time ./count
100000000

real    0m10.569s
user    0m10.560s
sys     0m0.010s

$ cat > count.c <<EOD
* main() {
*    int i;
*    for(i=0;i!=100000000;++i);
*    printf("%d", i);
* }
* EOD
$ gcc -o count count.c
$ time ./count
100000000
real    0m0.399s
user    0m0.400s
sys     0m0.000s
$ gcc -O3 -o count count.c
$ time ./count
100000000
real    0m0.003s
user    0m0.000s
sys     0m0.010s

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