From: David Masover Date: 2009-03-04T21:21:07+09:00 Subject: Re: Compiling a Ruby app Sharagoz -- wrote: > Im not concerned about reverse engineering or cracks being made for my > software. All I want is to be able to distribute it the traditional way > like most commercial software is (at least on the windows platform). > Great -- glad to hear it. Until you derail the whole thing with: > Open source makes code stealing too easy. > So does distributing software. Again, this will fail. be prepared for it. That aside... > I find it strange that there isnt a compiler readily available for Ruby. > Is there a technical reason why there shouldnt be one? > No. But there are technical reasons it's hard to create one. The biggest one is reflection: eval 'class Fixnum; def +(other); 42; end; end' Imagine the backflips a compiler would have to do in order to allow the above to work. You'd have no choice but to include the entire compiler with your program. If you then start hacking off every piece of metaprogramming and wizardy that makes Ruby hard to compile, you're killing a lot of what makes Ruby so great. > Is it because Ruby is ment to be pure open source and never used in the > commercial sector? > I think the Rails crowd might have something to say about that. It's not that anyone disapproves of you distributing a proprietary app. It's just a hard problem that open source people aren't likely to want to put much time into. After all, open source projects have no problem distributing as source code. That said, one of the side effects of JRuby and IronRuby is that you can probably find a way to compile to Java or .NET bytecode, and I'm sure there are reasonable ways to either compile these, or distribute them with something that makes it easy to install the runtime.