Ruby programming

Quote from Corey:

There are plenty of available packages for scientific computing in Ruby. The ones that spring to mind are the gsl bindings (ruby-gsl), statistics2, R bindings (ruby-rmathlib or rsruby), LAPACK bindings, libsvm bindings (RubySVM), etc...

That sounds quite reasonable. Thanks for taking the time and sharing.
 
Quote from Corey:

There are plenty of available packages for scientific computing in Ruby. The ones that spring to mind are the gsl bindings (ruby-gsl), statistics2, R bindings (ruby-rmathlib or rsruby), LAPACK bindings, libsvm bindings (RubySVM), etc...

Let me give you an example of how I used Ruby lately: I had about 20 years worth of historical fundamental company information on 300+ companies. It was pretty much quarterly information. First, I needed to parse all the files that the data was in and load it into a database. The ActiveRecord library made this easy -- and migrations made database maintenance even easier. Then, I had to run some analysis on the data -- analysis that would take a long time no matter what language you were using. But using Amazon's EC2 platform and distributed Ruby (DRb), I was able to quickly analyze the data by making the process parallel.

Could I have done this all in C++ or Java? I am sure I could have. But I bet that I would have had to have written a lot more code to get the task done. To me, I was willing to waste the extra CPU cycles for the sake of programmer ease...


Again, this is MY experience. I find Ruby useful. I also find it to be a pleasure to program in. Each tool in its place, as I continue to say. There is more than one way to skin the cat -- and LuaJIT is a very valid option. I just happen to find that Ruby works for me.

COOL, explanation!!
 
Quote from jagadish:

Twitter regrets using Ruby due to some scalability issues.

OP can make a mental note -- when his firm grows to $1b+ market value, he'll need to reengineer.
 
Wrappers around C/C++ libraries only get you so far with performance. As an example, I'm doing evolutionary computing where the evolution invokes a 'fitness function' for every individual on every generation. The fitness function has to be bespoke and isn't in any library although the library could do the evolutionary stuff. Currently it's doing a billion evaluations a minute and it still takes a weeks worth of processing on a quad core CPU to come up with a strategy that's worth trading.

Needless to say it's implemented in C and very tightly integrated to the library in order to maximise any possibilities for reusing partial computations.

You couldn't do that in Ruby unless you had a very large hardware and power budget. And what's the point, it will only take me twice as long to write it in C.

I have another issue with Ruby which is dynamic typing. It's great for noddy web applications where you can test to destruction to find all of the numerous errors but for finance it's a disaster.

In my code I will often not know whether I've implemented it correctly or not since it's using learning - it will naturally find a way around a badly implemented function that provides no benefit. So I need as much 'correctness' built into the development process as possible so that I then don't waste CPU cycles trying to evolve strategies against junk indicators and functions. Even strict typing in C/C++ is not adequate for this and I have spent many hours and days trying to find stuff that was needlessly wrong. Dynamic typing would make this much worse.

I'm now looking to move as much code as possible to Haskell because the type system is far stricter than C and purity helps ensure correctness as well. It will take me longer to write it in Haskell because you need to think harder, although there will be less code, and it will probably run 2-3 x slower than C but it should save in the overall time because bugs will be fewer.

I have used Ruby and I can see it's attractions, but my personal view is that, in this game, correctness is very important and performance is often a strong consideration.

If you like Ruby, you'll probably like Scheme also dynamically typed but compiled and integrates well with C. I've tried various languages looking for the perfect candidate but I always come back to C, for speed, and try and use Haskell for everything else.

The major issues that you'll have using anything other than C# is integration with trading platforms which ultimately is the point of the activity.
 
If you are interested in programming PM ME. I'm familiar w/ Laser, Sterling, IB, and Lightspeed, and learning others is pretty much easy

I am flexible. I am willing to do it for free providing I can get some equity, or I can charge.
 
Quote from Rodney King:

Are you using either package successfully? Latest activity seems to be in Jun 2004 http://sn.im/13f53c and Jan 2007 http://sn.im/13f55c, respectively.

Used rsruby successfully, but it doesn't seem to work well with Rails, which I tend to use as a front-end. I've successfully found my way around using it though...
 
Back
Top