From: Florian Gross Date: 2004-12-01T08:12:54+09:00 Subject: Re: Optional static typing (or, What can Ruby 2.0 borrow from Boo?) Daniel Berger wrote: > I was just looking at http://boo.codehaus.org/BooManifesto.pdf. One > thing I really kinda like is the optional static typing. Wouldn't > this allow potential compile time error checking and optimization with > a virtual machine running things? I imagine the syntax looking > something like this: > > def foo(String s, Hash h) > ... > end I agree that optional static typing is a nice thing to have, if only for providing optimization hints though it looks like in a perfect world Hotspotting and runtime type information would be used. I am no expert in this area so take my claims with a grain of salt. However the syntax you propose is not going to work out. If parameters can be typed the same should apply for variables. That would look like this with your syntax: String s = "hello" Hash s = {1 => 2} Float s = 5.0 But note that this is already valid syntax in Ruby and the latter doesn't even raise a NoMethodError: irb(main):018:0> Float s = 5.0 => 5.0 So I think we would need another syntax for this if it were to be implemented.