Re:Ahead-of-Time Compilation
by chrisseaton on Saturday October 01, 2016 @12:42PM
(#12618634)
> As you found out the hard way yourself.
That makes it sound like I implemented it - I didn't - I implemented the alternative mechanism which doesn't have the same problem.
You can implement an unsound static analysis for any language, and this in fact what Rubinius is doing: it's making potentially wrong conclusions about what instance variables will exist in objects. However, unsound analyses are outright harmful:
(0) Undoing unsound “optimizations” costs even more performance than was supposed to be gained by optimizing your program. (As you found out the hard way yourself.)
(1) They lie to you about what your code means! If this isn't bad enough, I don't know what else could be.
Unfortunately, a sound static analysis of Ruby code wouldn't be able to tell you much, precisely because Ruby allows you to subvert everything at runtime.