1 Dec 2002 01:00
Re: Numerical Ruby
MikkelFJ <mikkelfj-anti-spam <at> bigfoot.com>
2002-12-01 00:00:49 GMT
2002-12-01 00:00:49 GMT
"Olivier Saut" <Olivier.Saut <at> gmm.insa-tlse.fr> wrote in message news:20021201001712.48f6cb67.Olivier.Saut <at> gmm.insa-tlse.fr... > Hi all, > > I am now using Ruby to test my numerical schemes. Using Ruby for this > task was a real pleasure (I usually code in F90). The computations run > just fine but I would like to have a result a little faster. > > My code uses lots of loops as in the following example. Is there any way you could use Ruby to implement a symbolic evaluation instead of an explicit evaluation? Ruby is stronger in this aspect. Given a symbolic definition you could generate code on the fly - for example using inline C - but I guess that would add complexity rather than remove complexity from you implementation which may be beside the point of using Ruby. In the end it depends on whether you use Ruby because it is easier as an implementation language, or becuase you want the end users to be able to access the library from Ruby. The latter approach is good, the former is bound to be slow. There is also the NML language by dmcclaim which generates compiled ocaml code on the fly resulting in (claimed) rather fast evaluation of numerical applications even compared to C libraries because of the dynamic compilation of expressions. It might be a backend for a Ruby solution. http://home.mindspring.com/~dmcclain1/nmlpromo.htm the source is not online although listed:(Continue reading)
RSS Feed