From: Saynatkari Date: 2005-04-04T13:32:06+09:00 Subject: Re: Ruby rite (Ruby 2.0) vaporware or real? Richard Cole wrote: > Stephen Birch wrote: > >> Matz's keynote topic at Rubyconf in which Ruby 2.0 was introduced was >> in 2003. >> >> Does anyone know if any progress has been made on Ruby Rite or is it >> vaporware (http://en.wikipedia.org/wiki/Vaporware)? >> >> > Apart from the entry on Ruby-Garden > (http://www.rubygarden.org/ruby?Rite) there doesn't seem to be much > about on Google. I found the following project really interesting: > > http://www.atdot.net/yarv/#i-5-1 > > I dowloaded it and built it a couple of weeks ago, I got a small number > of build errors that were fairly easy to fix. When I tried it with > QtRuby though I think it fell over. > > Yarv generates byte code and hints at being Rite complient because you > have to run "ruby -rite" to activate it, but I couldn't find anything > explicit on the web page about support for Rite. > > Anyone else had success with Yarv yet? > > My major gripe with Ruby is that there's no static typing. I'd really > like to be able to do something like: > > interface ISubject > def notifyAll -- unit > def addObserver(a -- IObserver) -- unit > end > > interface IObserver > def subjectUpdate(subject -- ISubject) > end > end > > class Subject > def initialize > @observerList -- ISubject IEnum = Array.new() > end > ... > end You _can_ do that. You just do not have to specify the types of the Subject and Observer. > Why? because interfaces gives you a place define and explain protocols > of interaction. It also helps out the IDE, when you type @observerList > the IDE knows the type and can do name completion on it, hyperlink your > code etc. > > Also interfaces inheritance is very different to reuse inheritance. It > is so much clearer intentwise for a framework if the interfaces are > explicit, rather than being implicit. > > The major problem with interfaces is that you can't say later, oh, this > class implements that interface, but in Ruby, if there were interfaces, > the you could. Interface conformity is generally ensured by running unit tests on any classes that 'implement' the given 'interface'. > regards, > > Richard. E