From: Roger Pack Date: 2009-05-27T21:40:32+09:00 Subject: Re: [ANN] Diamondback Ruby - Static Typing for Ruby > Diamondback Ruby is intended to be another development tool in the > Rubyist's toolbox. When developing an application, you can use it to > discover bugs that may have been missed by your test suite or to verify > documentation through the use of explicit type signatures. gotcha--it shows you paths you may not have anticipated. >> Could it theoretically be used to create a ruby->c translator? > > Diamondback Ruby is built on top of a framework for Ruby source code > analysis and transformation, so "theoretically" you could use that to > build such a translator. However, the framework only gives you a > representation of the Ruby syntax (not unlike RubyParser) and does not > directly reason about the evaluation of this code. Thus, a C translator > would need significantly more information about the semantics of Ruby, > as all of this would have to be encoded in the emitted C code. Interesting. There are a few projects like ruby2c [1] that have attempted "something like that" I wonder if, given a code base of say a few ruby files that together make up a system, and, operating under the assumption that the code never uses define_method or eval or method_missing, you could convert the whole thing into C :) Has anything similar been invented? -=roger [1] http://betterlogic.com/roger/?p=1170 comment 1 lists a slew of them. -- Posted via http://www.ruby-forum.com/.