From: Brian Candler Date: 2009-01-23T19:48:22+09:00 Subject: Re: Choosing the most appropiate Ruby version and programming model to develop a SIP server I単aki Baz Castillo wrote: > Hi, I need to do a choice between the various Ruby versions (1.8, 1.9, > JRuby, > Rubinius...) and programming models (Reactor Model, Actor Model...) to > build > a SIP (VoIP) server. > > I've already started it and for now I've done a complete SIP grammar > parser > using TreeTpo parser, but probably I must migrate to Ragel in order to > get > more performance. Go back one step. You are concerned about performance before you've even written something. How critical is performance going to be to your finished product? If the answer is "very" then maybe Ruby is not the best platform in the first place. I'd suggest using Erlang instead: it's used in massive telephony systems, and has extremely good support for protocol handling. You'll need to buy Joe Armstrong's Erlang book (pragprog.com), and then you can make do with the on-line OTP documentation and looking at other people's code (e.g. mochiweb and yaws, which are HTTP servers). I even have a vague idea there is an existing Erlang SIP stack you can use. Ah, here it is: http://www.stacken.kth.se/project/yxa/ You can also hide Erlang very well. For example, couchdb and rabbitmq are both built on Erlang, but users don't see any of this. However, if you have some external requirement which means you *must* use Ruby, then understand that you may be trading ease of development against final performance and stability. Personally, I would start with the simplest possible implementation (e.g. using gserver.rb to accept incoming TCP connections in Ruby green threads), and get something working. Once you need to scale up, it should be pretty easy to refactor to some other model. -- Posted via http://www.ruby-forum.com/.