From: Roger Pack Date: 2009-06-07T03:54:00+09:00 Subject: Re: ruby2c? > I recall two things about ruby2c though: > 1) it translates the ruby in your code to C, but not any included code > or libs. At least that's all it did for me. The end result was I > could only translate rather simple methods, or small pieces of code to > C, not whole programs. > 2) it only worked in 1.8.x I did see some recent github commits to try and bring it up to 1.9 workability, but until I can actually get it to run...dunno. > ruby2cext (http://ruby2cext.rubyforge.org/) was fairly easy to get > going, even with rather complex programs/libraries. The resulting > code has to be run in ruby (just load it as a library I think..), but > it worked pretty well. Wow ruby2cext looks fascinating. It can even inline calls to core classes, like def go "".center 3 end gets translated to ruby C VALUE go_c(VALUE self) { return (*(string_center_which_we_already_looked_up_at_load_time))(NUM2INT(3)); } i.e. it avoids unnecessary function calls (if you pass it -O builtin_methods). Thanks! -=r -- Posted via http://www.ruby-forum.com/.