From: jm Date: 2005-08-03T09:44:38+09:00 Subject: Re: lowering ruby's reach On 02/08/2005, at 10:51 PM, Dave Burt wrote: >> I've been watching this and yarv with interest. I've tried yarv, but >> not >> zenspider's stuff as I've been waiting for a stable release and >> possible a >> how-to or walk through. Yet, this is just bolting C closer to ruby. >> It's >> like inline assembler. Don't get me wrong it should make it a lot >> easier >> to write extensions for ruby - especially those that are merely for >> speed >> gains. > > That doesn't sound like Ruby2C. From > http://rubyforge.org/projects/ruby2c/ - whoops, got a little confused there. I was actually thinking of the inline stuff. However, you note that in http://www.zenspider.com/~ryand/Ruby2C.pdf in slide 10 they state "Needs to be rewritten in the ruby2c subset" when referring to the ruby Interpreter and other parts in the following slides if it was to use ruby2c. Note also that in slide 25 the types are inferred to be of type int. What happens if you change a variables type? Does it silently turn off conversion, refuse to convert, produce two versions of the code or something else entirely? What I was think with the language_profile statement is that you can indicate to the compiler/interpreter what is the expected behavior so that if you code with one set of assumptions in mind the compiler won't switch to another. Equally you can tell it's alright to assume somethings because your aware of those assumptions and have taken factors into consideration. Further, it should warn you if you ask it to about certain things which in other situations would be quite normal. This approach would be advantageous compared to command line switches because of the level of granularity it gives you. It would allow you to set this on differing scopes with in the same program. Allowing the programmer greater control and letting the compiler match the programmers understanding and requirements better. After think about my original post a bit more there's a few things that could be done better. For example, forward declarations example is no good as it's too simple and it could be done in way the is more compatible with the standard ruby interpreter. The trouble is that this is a blurry subject at best. And, my understanding of it is limited which is why I'm asking questions and thinking aloud. Jeff.