From: Olivier Saut Date: 2002-12-02T21:23:05+09:00 Subject: Re: Numerical Ruby On Mon, 02 Dec 2002, Mauricio Fern�ndez wrote: > > > > Yes. After a rewrite following Masahiro's suggestion, my code is 50 > > times faster! > > Can you estimate how its speed compares to something written in, say, > Fortran? I will write a similar code in f90 in the next weeks, then I'll be able to compare the two. I'd say f90 should not be noticeably faster that the ruby code using the full power of NArray. NArray is written in C. If there is some interest, I'll post the results to the list. The only difference I see is that using f90 I can get parallelism to speed up the computations (through OpenMP or MPI). > > Could Ruby be made suitable for scientific apps if it were used as a > glue to bring together extensions written in C? And could it possibly be > made even faster if Ruby objects were smart enough to do some > optimization based on their properties? IMHO, with extensions like NArray, Ruby is suitable for scientific apps. The heavy numerical computations are performed at the speed of a C program, and you keep Ruby to write your input/output methods and to make a GUI. However I have tested only with codes able to run on a personnal workstation. I don't know how it would scale for larger codes (fluid dynamics...). Perhaps some japanese Rubyists are already using Ruby for large projects as many Ruby extensions for computational physics are written by japanese people. Python starts to be mentioned in some of the conferences (in applied mathematics) I attend, there is no reason Ruby could not be used as well. > > Bringing together Ruby's convenience and expressive power with > acceptable speed would be absolutely awesome. I could not agree more. Best regards, - Olivier