Le 29 mars 06, =E0 11:04, graham a =E9crit :
People seem to want a compiler for 2 reasons
a) improved performance
b) securing their source
a) could be addressed by YARV, as previously commented
b).. is it possible to do something simple like encrypt the source=20
file and have ruby decypt the file "on-the-fly" as it reads it at=20
run-time? The encryption key could be client specific and hence the=20
code secure. I guess it would need Ruby VM to have a new command line=20=
mode (i.e. "start-up on the fly decryption - and here is my=20
certificate"), and the source to be encypted / packed by something=20
like rubyscript2exe
Would this make a worthwhile quiz??
There are already been discussion about this on some schemed proposed.=20=
But it usually didn't take very long for some clever people to write a=20=
script to decrypt to program and spit it out. It probably isn't=20
possible to make something hard to figure out without modifying the=20
interpreter itself, as if you stay in pure Ruby, the code is decrypted=20=
at some point and thanks to Ruby's dynamic properties, you can always=20
add some code at that very point.
Now if you modify the Ruby interpreter and do not release the source of=20=
it, it can be as obfuscated as you can make the decryption piece in the=20=
binary of your new interpreter. As soon as someone figure out your=20
encryption scheme, he/she can compile a ruby interpreter of their own=20
to spit out the code just before it is executed...
Guillaume.