From: Steven Jenkins Date: 2005-07-08T03:26:12+09:00 Subject: Re: Ruby as mathematical language Phil Tomson wrote: > none wrote: >>I wish I was a better programmer and could implement my extensions in >>ruby-gsl's C. One option would be to reimplement rb-gsl using SWIG. GSL is pretty big, but wrapping it with SWIG might not be too hard if its interfaces are implemented using a small number of types. You have to write two or three typemaps for each type, and SWIG does the rest. I've wrapped two libraries with SWIG. and while I don't consider myself an expert, I have learned a few things. I'd be willing to help get things kicked off. One thing to bear in mind, however. Wrapping (whether with SWIG or not) often requires copying input and output parameters. That's usually not a big deal, but you might take a substantial performance hit if you're passing large numbers of large arrays through a wrapper. >>[snip] > > As far as using Ruby as a mathematical language something like MatLab: > That would be very nice. Given that it's quite easy to create DSLs using > Ruby one would think it should be possible to create something that would > give MatLab a run for it's money (I really don't like MatLab as a > langauge). Also consider that you need to tightly integrate graphing > (perhaps through gnuplot?). Much of the value of Matlab is not the language itself, but the large number of libraries available for specialized applications like control systems and signal processing. That's much harder to replace than the underlying execution engine. (Which is, of course, part of the reason Fortran is still with us.) Steve