3 ms·
Ah, YARV finally adds bytecode compilation and loading as an "experimental" feature. It'll be interesting to see what people do with it.
by omarforgotpwd 11y ago
Ah, YARV finally adds bytecode compilation and loading as an "experimental" feature. It'll be interesting to see what people do with it.
- rubiquity 11y agoI could see it making deployment faster or nicer. Imagine being able to compile all the byte code for a Rails app locally and just shoving that up instead of waiting on bundling and all that. Also I think this would make possible hot code upgrades which are cool but probably more work than their worth. Unless you can build smart hooks into background job and web server libraries that only change the byte code in between jobs and requests. Oh the possibilities!
- rubiquity 11y agoAfter reading the patch that introduced the byte code compilation it seems what I was hoping to use it for are clearly not goals of the project: https://bugs.ruby-lang.org/issues/11788 https://bugs.ruby-lang.org/issues/11788
- pmontra 11y agoI'm not sure the prospects are so bleak. I made some tests and I could run the compiled code on another machine with a different directory structure. See https://ilconnettivo.wordpress.com/2015/12/25/ruby-2-3-0-instructionsequence/ https://ilconnettivo.wordpress.com/2015/12/25/ruby-2-3-0-ins...
- rubiquity 11y agoI was curious just like you and gave this a try too. Seems that while the project is intended for this you can easily build this. Thank you for writing that up!
- MrBra 11y agoAs someone else pointed out, at https://bugs.ruby-lang.org/issues/11788 https://bugs.ruby-lang.org/issues/11788 they explain that: They are not goals of this project: - packing scripts to one package - migrate obfuscate binary to other node to hide source code --- But.. what I don't get is: why wouldn't this works as a cheap way to obfuscate some ruby code? After all, isn't it true that when a script is compiled to byte-code then it is interpreted by the runtime as-is (and without being re-translated to the original script in memory or on disk) ? If so - I understand that rebuilding the original ruby script would not be a big deal for a developer - but wouldn't this still pose a small barrier to the casual prying user?