From: Franz Hartmann Date: 2005-05-11T20:43:45+09:00 Subject: Re: ruby vs. java? Hello Jaypee, >From: Jaypee >Reply-To: ruby-talk@ruby-lang.org >To: ruby-talk@ruby-lang.org (ruby-talk ML) >Subject: Re: ruby vs. java? >Date: Wed, 11 May 2005 20:05:28 +0900 > >Franz Hartmann a �crit : >>Hello Jaypee, >> >>>From: Jaypee >>>Reply-To: ruby-talk@ruby-lang.org >>>To: ruby-talk@ruby-lang.org (ruby-talk ML) >>>Subject: Re: ruby vs. java? >>>Date: Wed, 11 May 2005 18:25:27 +0900 >>> >>>Franz Hartmann a �crit : >>> >>>>Hello all, >>>> >.... >>>>ps. does ruby run on macintosh tiger? >>>> >.... >>>> >>>I can answer to the PS: yes, the version 1.8.2 of ruby is a standard part >>>Tiger. >> >> >>That is very good. Because i think to buy a macintosh perhaps. the G5 is >>now at 2x2.7 ghz and i think this is just what i need. can ruby handle two >>processors? (or do i need a c extension for that *g* ?) >>btw, i know this is a ruby list but is their any way to run windows >>programs on mac? >> >>>For the other points, may I suggest you to be specific about what you are >>>looking for in VB or in Java (GUI, ready to use libs etc) that you >>>did not find. It will help further answers. >>>J-P >> >> >>yes you may but i myself dont know yet :-) . i think windows and graphics >>will be needed. 3d graphics would be super to present the results. >>as i wrote before, going into libraries is not a problem, i have all the >>books and documentations. >> >.... >Franz, >I have myself somehow tested this and unfortunately, ruby shall not take >advantage of the dual CPU. The example I used for this was the calculation >of the factorial of 100000. This is IMHO a good example to discuss the >performance question. Yes, and i am schocked... i have a pentium 3 box (900 mhz) which give me 1800 mips and it needs 14 min 43 secfor the calculation of 100000 multiplications. 14 x 60 + 43 sec = 883 sec 100000 operations / 883 sec = 113 flops??? c64 basic calculated 10000 sqrts within less than 20 minutes, that amount to 10000 / 1200 = 8 flops. at 0.9 mhz, that is 1/1000. (8 / 113) / (0.9 / 900) = 70.8 Does this mean that ruby is 70 (seventy) times slower than c64 basic, not counting the advantages of 32 vs 8 bit???? Or did i just make some very stupid error? Here's the program: def fac( n ) f = 1 (1..n).each { |x| f *= x } return f end print "%d\n" % fac( ARGV[0].to_i ) >Especially in your case, where you master a domain where other people are >generally of little help, you need to be very autonomous That's what our professors always tell us to. :-( >and in that regard, Ruby is very good, it helps you to really cope with >some level of complexity. In the example of the factorial. It takes 1 >minute to write in ruby and even if you deal with a very large integer, >it's ruby's business, not yours, and it takes 10 min or so to compute. > >Or you may get the result in ten seconds after one day of laborious coding >in another language. Which language was best in that example? The one where it takes me 1 min to write and 10 sec to run. why is their no such thing? >Just my 2 cents (of Euro) >Jean-Pierre >PS: There are ruby-Tk, ruby-OpenGL, ruby-Fox (careful I did not test it as >thoroughly as it would be necessary), ruby-SVG, ruby-fltk ... interfaces to >best known graphical libraries or toolkit to make desktop or web user >front-ends. thanks, i'll have a look. Franz _________________________________________________________________ Die rote Karte f�r l�stige E-Mails. MSN Hotmail mit Junk-Mail-Filter. http://www.msn.de/antispam/prevention/junkmailfilter Jetzt kostenlos anmelden!