would it be possible to convert a scripting language like Python or Ruby so that it compiles directly to machine code? if so would it be as fast as Pascal/Delphi? would it be possible to give languages like Python the option to declare types statically to override the dynamic typing?
And no, it wouldn't be as fast as Pascal, based on the history of specializing compilers for dynamic OO languages. The fact that Python's dynamic dispatch is a series of hashtable lookups instead of a single table access for every (method call|messsage dispatch) puts such a dent on performance that apparently no amount of optimization (as far as we know) can completely eliminate.