From: Charles Oliver Nutter Date: 2010-09-30T06:38:53+09:00 Subject: [ruby-core:32643] Re: Proposal for Optional Static Typing for Ruby On Wed, Sep 29, 2010 at 3:43 PM, Ryan Davis wrote: > This problem was tackled by Dave Ungar ages ago and is the reason why your beloved java is finally fast. It wasn't the types that made java fast. Java had that from the beginning and it was doggedly slow. It was the hotspot technology that made it fast. > > I had a wonderfully enlightening talk with him 2 OOPSLAs ago that opened my eyes to a lot of possibilities for rubinius. You should have talked to him when he worked "down the hall" from you. Java was slow in the beginning because it was only being interpreted. Early "dumb" JITs that just translated to native code helped a tremendous amount, and later "smart" JITs like those based on Self and StrongTalk research helped with the last mile. But those "smart" JITs work well because of JVM type-system truths: types are immutable (static type structure), primitives are always primitives (static typing), invocations specify a specific target type + signature (static typing), and static methods/fields can be accessed directly without any guards (static typing). Ruby provides no such guarantees, making optimization more difficult. And of course I didn't say it wasn't possible to make dynamic languages fast. It's just a lot harder than making statically typed languages fast. - Charlie