From: Florian Gilcher Date: 2009-03-05T01:52:29+09:00 Subject: Re: Compiling a Ruby app On Mar 4, 2009, at 12:47 PM, David Masover wrote: > Rick DeNatale wrote: >> On Tue, Mar 3, 2009 at 5:09 AM, David Masover >> wrote: >> >> >>> Sharagoz -- wrote: >>> >>> >>>> My second concern is protecting source code. >>>> I realize that everything that can be compiled can also be >>>> decompiled, >>>> >>>> >>>> >>> That is not entirely true. Or rather, it can be "decompiled", all >>> right, >>> but not into anything resembling the original source code. >>> >> >> >> Actually closer than you might think: >> >> require 'rubygems' >> require 'ruby2ruby' >> > > I was speaking of compiled languages in general. As a trivial > example, a common C optimization is to inline functions which are > below a certain size. Now, when decompiling, how do I know what was > inlined, and what really should be duplicate code? Thats the problem of decompiling native code to a language. Usually, Bytecodes like Java and .NET are very well decompilable, because they retain a lot of the language instructions within the code. I suspect the same to be true for YARV code. For example, inlined Code is possible in Java, but there are still symbols for determining where it originates from (for the sake of Backtraces for example). In the case of Ruby, this also allows you to read stuff like your dynamic method example. Regards, Florian -- Florian Gilcher smtp: flo@andersground.net jabber: Skade@jabber.ccc.de gpg: 533148E2