From: Eric Hodel Date: 2005-05-05T03:43:11+09:00 Subject: Re: I rock. On 04 May 2005, at 08:14, Bill Guindon wrote: > On 5/3/05, Ryan Davis wrote: >> >> On May 3, 2005, at 3:45 PM, Eric Hodel wrote: >> >>> On 03 May 2005, at 15:21, Ryan Davis wrote: >>> >>>> If you want performance then you should either hand write (using >>>> RubyInline!) or take a peek at zenoptimizer when it gets released in >>>> my ZenHacks package (it uses a combination of ruby2c and rubyinline >>>> with a custom lightweight profiler I wrote last week). >>> >>> Yes. When you find a slow part, you could use this as your template. >>> You'll have working Ruby/C code to refactor into faster C code in no >>> time at all. >> >> oooh. I didn't think of that. Not sure why. :P >> >>> I should be able to skip rb_funcall for places where I know the >>> types, >>> and directly call the C implementation of a method. That will be >>> more >>> work though, because I'll have to fall back in case a TypeError is >>> raised in addition to pulling the right bits from the VALUE. >> >> *nod* >> >> I expect that we'll do a version down the line that includes >> TypeChecker in the SexpProcessor pipeline and we'll have better sends >> in that version. >> >> Isn't it cool that we have these discussions out on a public list like >> ruby-talk??? It is almost like, oh I dunno, we want people to look at >> the software! ;) > > Not being a c programmer, I've been watching this thread (and some > others) mostly out of curiousity. But I'm beginning to get the > impression that the two of you are on the verge of having a full Ruby > to C converter. Is that an overestimate? I think that is on-target. > If a full conversion is likely, any idea on a time line? What would > be the likely limitations? For Ruby2RubyC, you trade safety for speed (but I may be able to do something about that), and you are limited in what is translatable. Code in a class or module, or at the top level can't be translated. The translator isn't fully done yet, I don't know if things like constant lookup actually works, and I didn't do anything to make global variables work. Those things can be fixed. It may do different things with scoping of variables too. > Write it in Ruby, convert it to c, compile it, distribute it. That > really would be something. Especially for the non c programmers like > myself :) For a Ruby subset, yes, you can do that. Just for a larger subset than Ruby2C. -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04