From: Ryan Davis Date: 2011-07-27T06:50:12+09:00 Subject: Re: Ruby to C transpiler On Jul 26, 2011, at 07:11 , Robert Klemme wrote: > Hans Mackowiak wrote in post #1013101: >> translating an ruby program into an c program is not as simple possible >> because of ducktyping and dynamic stuff like including and extending >> objects ans classes > > Performance gains would probably be marginal - unless all the dynamic > features were omitted. For type-inferred code we saw ~12x improvements. For straight translations w/ fully dynamic ruby we saw marginal performance losses because we couldn't cheat the way the interpreter does (eg regexp match nodes dispatched directly where we had to use rb_funcall or we couldn't take advantage of COW string hacks). I demonstrated this in my rubyconf 2005 talk. I don't think any video of it exists. >> c or c++ chould not handle that as simple > > Nobody talked about "simple" though. Translating was a lot less tough than I thought it would be (compared to, say, the parsing of ruby).