Ruby with Qt or GTK?

Good points made. Here’s a lighter side to this digressing thread
(originally regarding GUI toolkit choices for Ruby). Check out
something like this →
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/303ed6cf57a16da8/35181e1c691a3af3?lnk=gst&q=whitespace+quiz&rnum=1#35181e1c691a3af3.
Ruby code obfuscation very tongue in cheek!

On Thu, 28 Sep 2006 03:27:44 -0700, gregarican wrote:

I realize that Ruby 1.8.x code can be at best only obfuscated, not
compiled. So obviously created a closed source product with Ruby would
be out of the question. Even a Ruby 2.0 YARV bytecode-compiled product
could be reverse engineered, as is the case with Python offerings. But
just because something is commercial doesn’t necessarily mean that
it’s closed source, does it?

Ruby can’t even be really effectively obfuscated (at least not as
effectively as Java), because it depends on things being named the same
for duck typing to work. In Java, you can rename any method in the
inheritance chain that isn’t defined in the parent class, you also get
overloading to help with the obfuscation so you start by renaming
functions to as many overloads of “a” as possible, then to as many
overloads of “b” as possible and so forth. In Ruby, you don’t have the
naming heuristic, nor do you have the ability to create many overloads
of
the same function.

Even Java bytecode can be decompiled, and I suppose a hypothetical
native-compiled Ruby program would have a lot more information in it
than
a native-compiled Java or C++ program, and you could still do a good job
of reverse-engineering a Ruby program.

–Ken

On 9/28/06, Ken B. [email protected] wrote:

Ruby can’t even be really effectively obfuscated (at least not as
effectively as Java), because it depends on things being named the same
for duck typing to work. In Java, you can rename any method in the
inheritance chain that isn’t defined in the parent class, you also get
overloading to help with the obfuscation so you start by renaming
functions to as many overloads of “a” as possible, then to as many
overloads of “b” as possible and so forth. In Ruby, you don’t have the
naming heuristic, nor do you have the ability to create many overloads of
the same function.

Java includes all naming in the compiled bytecodes as well, because
it’s an integral part of the method signatures. Java code can be
decompiled to almost exactly what was fed in, with few exceptions.

Under JRuby, Ruby code will probably be obfuscated even more than Java
code. I’ve been working on the compiler for JRuby, and I guarantee the
resulting bytecode won’t be easily reversible. You might be able to
reverse it to some pretty heinous Java code, but reversing back to the
original Ruby source will be practically impossible. Even if the
method names are still present, everything else will be Java
bytecodes, many of them specific manipulations of JRuby’s runtime.
Ruby’s AST itself can be reversed, but not perfectly, and if passed
through a compiler like the one in JRuby, it will be mostly
unrecognizable.