From: Eric Hodel Date: 2006-07-29T11:19:17+09:00 Subject: Re: converting some autogenerated ruby code to C On Jul 27, 2006, at 2:25 PM, Eric Mahurin wrote: > One of the next things I want to do in my grammar package is to give > it a performance boost by generating C code instead of ruby code. > Right now the parsers I generate are a set of a few methods with giant > expressions in each. I would like to try improving the performance by > generating and compiling C code instead. My preference would be to > convert my small subset of ruby code to C code (easily have an option > to use pure ruby or use ruby/C), but I could also autogenerate C code > instead. Anybody have any opinions/ideas about what approach I whould > take? I saw a rubyToC package on rubyforge that I could possibly use, > but I can't seem to find any good documentation/examples. Well, we don't have any examples yet. We're still driving features into it from concrete ruby code so haven't focused on documentation because most people aren't using it. The best example is the zenoptimize demo in ZenHacks. > It also looks like it has some type inference that I don't want (I > take > advantage of duck typing quite a bit). It is largely optional, we need it in the ANSI C translator (int, double, char *, etc). In the Ruby C translator (VALUE) it could be fairly easily removed. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com