Computer Language Shootout!

Συζητήσεις για γλώσσες προγραμματισμού και θέματα σχετικά με προγραμματισμό.
Post Reply
User avatar
AmmarkoV
Wow! Terabyte level
Wow! Terabyte level
Posts: 2838
Joined: Thu Nov 04, 2004 2:55 pm
Gender:
Location: Reloaded @ Santa Friday
Contact:

Computer Language Shootout!

Post by AmmarkoV » Sat Mar 17, 2007 3:46 pm

Computer Languages Shootout :)
Το βρήκα εδώ!

Είναι benchmarks σε Gentoo σύστημα οπού βάζεις πολλαπλασιαστές δεξιά σχετικά με αυτά στα οποία θέλεις να είναι καλός ένας compiler και σου βγάζει αποτελέσματα.. Τα αποτελέσματα είναι από σύστημα με P4 CPU :-D

Οι κορυφαίες overall γλώσσες/compilers C (gcc) , C++ (g++) ενώ η Pascal (Free Pascal :) :-D :) :-D :smt025 ) τα πάει πολύ καλά δικαιώνοντας την αγάπη μου! :smt060

Μούχαχα!
Python , PHP , Java , C# (Mono) σέρνονται κάπου στην μέση..
Λέει πάνω πάνω
Can you manipulate the multipliers and weights to make your favourite language the fastest programming language in the Shootout? ;)

Επίσης στο startup test η java κάνει 36.22 secs για να εκτελέσει το εξής

Code: Select all

public class hello {
    public static void main(String args[]) {
	System.out.print("hello world\n");
    }
}

Και να το καλέσει 
repeat %A /opt/sun-jdk-1.6.0/bin/java $JDKFLAGS -server -classpath hello.java_run hello

Ενώ η C (GCC) 0.39 secs

Code: Select all

int main() {
    fputs("hello world\n", stdout);
    return(0);
}
Και να το καλέσει 
 repeat %A hello.gcc_run
Και η Pascal 0.28 secs

Code: Select all

program hello; 
begin
  WriteLn('hello world');
end.

Και να το καλέσει 
repeat %A hello.fpascal_run
Συνάδελφοι τα σχόλια σας..
Spoiler: εμφάνιση/απόκρυψη
I would love to change the world, but they won't give me the source code. Οι καθηγητές πληρώνονται από το δημόσιο αρα από όλους τους Έλληνες για να κάνουν τα μαθήματα. Όλοι οι Έλληνες θα έπρεπε να μπορούν να δουν τα μαθήματα τα οποία πληρώνουν! Tο πνευματικό έργο που επιτελείται με τα χρήματα του δημοσίου ΔΕΝ είναι μόνο δικό σας Όποιος δεν δίνει πανελλήνιες έχει δικαίωμα στην γνώση που πληρώνει [url=http://ammar.gr/gddg]gddg blog[/url]
Image
Babedacus
Kilobyte level
Kilobyte level
Posts: 299
Joined: Mon Nov 21, 2005 1:05 pm

Re: Computer Language Shootout!

Post by Babedacus » Thu Mar 29, 2007 4:50 pm

AmmarkoV wrote:Gentoo P4 CPU
κορυφαίες γλώσσες/compilers C (gcc),C++ (g++),Pascal (Free Pascal)
Μούχαχα!
Python, PHP,Java,C# (Mono) σέρνονται κάπου στην μέση..
Ε λογικό είναι ρε συ αφού έχει πέντιουμ 4,αν είχε Java Bytecode επεξεργαστή (ARM926EJ-S) θα κέρδιζε η Java και οι άλλες γλώσσες θα χάνανε. :twisted:
Όταν όμως καταφέρει η ανθρωπότητα να φκιάσει επεξεργαστή αντάξιο της Java,τότε η σύγχυση των γλωσσών θα πάψει και θα ζούμε για να υμνούμε τον ένα και μόνο δημιουργό,τον James. :lol:
User avatar
AmmarkoV
Wow! Terabyte level
Wow! Terabyte level
Posts: 2838
Joined: Thu Nov 04, 2004 2:55 pm
Gender:
Location: Reloaded @ Santa Friday
Contact:

Post by AmmarkoV » Thu Mar 29, 2007 5:41 pm

Babedacus++ ;)
Spoiler: εμφάνιση/απόκρυψη
I would love to change the world, but they won't give me the source code. Οι καθηγητές πληρώνονται από το δημόσιο αρα από όλους τους Έλληνες για να κάνουν τα μαθήματα. Όλοι οι Έλληνες θα έπρεπε να μπορούν να δουν τα μαθήματα τα οποία πληρώνουν! Tο πνευματικό έργο που επιτελείται με τα χρήματα του δημοσίου ΔΕΝ είναι μόνο δικό σας Όποιος δεν δίνει πανελλήνιες έχει δικαίωμα στην γνώση που πληρώνει [url=http://ammar.gr/gddg]gddg blog[/url]
Image
User avatar
HdkiLLeR
Venus Project Founder
Venus Project Founder
Posts: 4356
Joined: Tue Jan 27, 2004 4:41 pm
Academic status: Alumnus/a
Gender:
Location: New York, NY
Contact:

Post by HdkiLLeR » Thu Mar 29, 2007 6:40 pm

Χμμ..παλιά μου αγάπη (Haskell) δεν πάει και άσχημα :)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d-->--- s+:+ a- C++(+++) BILS++++$ P--- L++++>+++++ E--- W+++ N+ o+ K w--
O M+ V-- PS++>+++ PE- Y++ PGP++ t+ 5+ X+ R* tv b++ DI- D+ G+++ e+++>++++ h r++ y++
------END GEEK CODE BLOCK------

"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." -- Dennis Ritchie
User avatar
AnINffected
Gbyte level
Gbyte level
Posts: 1935
Joined: Fri Jul 30, 2004 7:12 am
Location: There and Back Again

Post by AnINffected » Fri Mar 30, 2007 9:34 am

Τα βάρη πώς λείτουργούν ακριβώς;

Σωστά τα λέει ο Babedacus!
Οι interpreted γλώσσες γενικά λογικό δεν είναι να έχουν το συγκριτικό μειονέκτημα έναντι των executed;

Ας μετρούσε και compile time και όχι μόνο run time... ;)

Πολύ ενδιαφέρον πάντως.

Υ.Γ. Άλα τις η D! (Digital Mars)! Μόλις πιό κάτω από τις C/C++;
Εντυπωσιάστηκα τώρα...

Υ.Γ.2. H C++ είναι η προσωπική μου αγαπημένη!
Λίγο ακόμη και δεν θα χρειαζόταν tweaking... :cool:
The Analytical Engine has no pretensions to originate anything. It can do whatever we know how to order it to perform (...)
Ada Lovelace


Θέλω και εγώ να παίξω D&D λέμε!!! :-( :-(
User avatar
PaP
Venus Project Founder
Venus Project Founder
Posts: 1077
Joined: Wed Apr 21, 2004 12:06 am
Academic status: Alumnus/a
Location: San Francisco
Contact:

Post by PaP » Fri Mar 30, 2007 10:34 am

Ετσι να βγάλετε τα μάτια σας !!
Δε με ενδιαφέρει τη αγαπάει το μηχάνημα αλλά τι αγάπανε οι άνθρωποι και αυτό λέγεται Ruby :P
Τόσα τραγούδια υπάρχουν
In Ruby's arms - Tom Waits
Ruby Tuesday - Rolling Stones
Ruby - Kaiser Chiefs
User avatar
AmmarkoV
Wow! Terabyte level
Wow! Terabyte level
Posts: 2838
Joined: Thu Nov 04, 2004 2:55 pm
Gender:
Location: Reloaded @ Santa Friday
Contact:

Post by AmmarkoV » Fri Mar 30, 2007 5:05 pm

AnINffected η Java δεν είναι εντελώς interpreted..
Java wrote:"Remember how HotSpot works. It starts by running your program with an interpreter. When it discovers that some method is "hot" -- that is, executed a lot, either because it is called a lot or because it contains loops that loop a lot -- it sends that method off to be compiled. After that one of two things will happen, either the next time the method is called the compiled version will be invoked (instead of the interpreted version) or the currently long running loop will be replaced, while still running, with the compiled method. The latter is known as "on stack replacement" and exists in the 1.3/1.4 HotSpot based systems."

Άνοιξα λίγο Ruby
Αλλά ρε PaP πολύ ασυνταξία..
Οι εντολές βέβαια είναι πολύ μεστές αλλά περίεργες (!)
Βέβαια το καλό είναι οτι μπορείς να χρησιμοποιήσεις DLL`s κτλ οπότε θα επιταχύνεται το πράμα (γράφοντας parts σε άλλη γλώσσα βέβαια) αλλά είναι τέρμα αργή από ότι δείχνει το benchmark.. :-D

Code: Select all


# Output "I love Ruby"
say = "I love Ruby"
puts say
 
# Output "I *LOVE* RUBY"
say['love'] = "*love*"
puts say.upcase
 
# Output "I *love* Ruby"
# five times
5.times { puts say }

Code: Select all

class Numeric
  def plus(x)
    self.+(x)
  end
end

y = 5.plus 6
# y is now equal to 11


Φοβερό comment στο site είναι αυτό..
They raced up, and down, and around and around and around, and forwards and backwards and sideways and upside-down.

Cheetah's friends said "it's not fair" - everyone knows Cheetah is the fastest creature but the races are too long and Cheetah gets tired!

Falcon's friends said "it's not fair" - everyone knows Falcon is the fastest creature but Falcon doesn't walk very well, he soars across the sky!

Horse's friends said "it's not fair" - everyone knows Horse is the fastest creature but this is only a yearling, you must stop the races until a stallion takes part!

Man's friends said "it's not fair" - everyone knows that in the "real world" Man would use a motorbike, you must wait until Man has fueled and warmed up the engine!

Snail's friends said "it's not fair" - everyone knows that a creature should leave a slime trail, all those other creatures are cheating!

Dalmation's tail was banging on the ground. Dalmation panted and between breaths said "Look at that beautiful mountain, let's race to the top!"
Spoiler: εμφάνιση/απόκρυψη
I would love to change the world, but they won't give me the source code. Οι καθηγητές πληρώνονται από το δημόσιο αρα από όλους τους Έλληνες για να κάνουν τα μαθήματα. Όλοι οι Έλληνες θα έπρεπε να μπορούν να δουν τα μαθήματα τα οποία πληρώνουν! Tο πνευματικό έργο που επιτελείται με τα χρήματα του δημοσίου ΔΕΝ είναι μόνο δικό σας Όποιος δεν δίνει πανελλήνιες έχει δικαίωμα στην γνώση που πληρώνει [url=http://ammar.gr/gddg]gddg blog[/url]
Image
User avatar
PaP
Venus Project Founder
Venus Project Founder
Posts: 1077
Joined: Wed Apr 21, 2004 12:06 am
Academic status: Alumnus/a
Location: San Francisco
Contact:

Post by PaP » Fri Mar 30, 2007 7:06 pm

Και τι να την κάνεις την ταχύτητα με τους σημερινούς υπολογιστές ; Ολοι τα μηχανήματα κατά κύριο λόγω είναι idle και αν δε μιλάς με υλικό ή δεν κάνεις critical εφαρμογή (που δεν είναι και ότι πιο συχνό) γιατί να μη γράψεις κάτι lean and clean και να στο επικεντρωθείς sta features και όχι στην υλοποίηση...
Ruby/Python rules
Post Reply

Return to “Προγραμματισμός”