From: Renald Buter Date: 2001-05-15T20:40:45+09:00 Subject: [ruby-talk:15155] Re: bytecode compilation On Tue, May 15, 2001 at 01:27:00PM +0100, ruby-talk@ruby-lang.org wrote: > On 5/15/2001 01:34 AM, Sean Russell wrote: > >-----BEGIN PGP SIGNED MESSAGE----- > >Hash: SHA1 > > > >Je Dimancxo 13 Majo 2001 15:53, vi skribis: > > > Not exactly what you want, but look at ruby2c (rb2c) > > > http://www.ruby-lang.org/en/raa-list.rhtml?name=rb2c > > > >This is a wonderful idea, but I have three problems with it: it only works > >with Ruby 1.4; the resulting executables are HUGE (but this could be a result > >of my linking options); and the executables seem to be no faster than the > >original script. > > > >I'm not complaining about rb2c; I just don't see the point of using it. > > As the case with compiling other scripting languages, speed gain or > small binary is not achievable anyway, because your scripting language > code is not transformed into C, but merely packaged together with the > interpreter. All the dynamic scripting languages are very hard to > transform to C because of their nature. They still need the interpreter > runtime to operate. > > So the benefits of "compilation" are: > > 1. packaging (making it easier for user) > 2. source code hiding (making it harder to see/less obvious) > > Regards, > Steve Probably a silly question, but how about 2native, JIT, etc. Would this also be uncommonly hard to achieve? As I have always understood, converting to C is used as an intermediate step towards native code, with while keeping a some kind of a pseudo platform-independency --- or am I wrong here? Renald