From: Mike Furr Date: 2009-05-28T01:21:19+09:00 Subject: Re: [ANN] Diamondback Ruby - Static Typing for Ruby Roger Pack wrote: > 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? There have been several projects that attempt to translate high level languages into C (e.g., the Scheme Chicken compiler). However, I don't know why you would want to do this for Ruby now that 1.9 uses a proper VM. Instead of developing a compiler to target C, why not just target the YARV bytecode? If you are trying to really optimize Ruby, then you'll likely want both static optimizations (generating efficient bytecode, minimizing GC pressure), and dynamic optimizations (hotspot JIT compilation). The latter is especially important for Ruby since you could support for features like eval (just eject any optimizations that are invalidated by the eval'd code and recompile as necessary). In fact, I believe that many of the ideas that went into making the JVM so efficient came out of the Smalltalk community's work on optimizing dynamic VMs. Cheers, -Mike -- Posted via http://www.ruby-forum.com/.