Exactly, exactly, Bulat.  I have been thinking exactly the same
idea.  Static typing for certain variables is really used to circumvent
Ruby intermediary steps and go directly to the corresponding machine
instruction code.

(Well, an analogy in C++ is the use of "inline" keyword, where there it
is used to possibly speed up that portion of the code.  Now, in Ruby if we
later want to use static typing for checking syntax error also (at
compile time), that is another possibility...)

To achive 80% of C performance, on the other hand, I think we still have
along way to go, and probably it will require something more than simply
static typing...

Regards,

Bill
============================================================================
Bulat Ziganshin <bulatz / integ.ru> wrote:
> well. consider "2+2" example. when we compile ruby to c, we need to
> dispatch to Fixnum.+ method. if we exactly know what Fixnum.+ body is:

> Fixnum +(Fixnum b)
>   return integer_add( self.representation, b.representation)
> end

> then we can compile "2+2" to just one c/asm instruction. if we don't
> know, we have to call rb_funcall with all those overhead. so, if i'm
> right, strong typing is the first and most important step to fast
> compiled code. i say nothing about interpreter, it is topic for another
> discussion

> -- 
> Best regards,
>  Bulat                            mailto:bulatz / integ.ru