From: Roger Pack Date: 2010-09-29T02:04:10+09:00 Subject: [ruby-core:32607] Re: Proposal for Optional Static Typing for Ruby > If any of you have used Objective-C, you will have likely encountered two things. In terms of objects it is duck typed, yet it also offers static typing. Now there are many differing opinions on static typing. Some believe everything should be statically typed and to do otherwise is to allow for errors in your code. Some believe everything should be duck typed and that with careful coding and testing you can have lots of flexibility with few, if any errors. To a very large degree I am in the latter camp. However, I also see the benefits of static typing and how it can help developers explicitly state assumptions and as such help developers test those assumptions. I agree that ruby would be nice if it could optionally support static types (for speed, mostly). Unfortunately I'm not certain if ruby proper will ever support such a thing, since it is reasonably hard and Ruby itself tends to favor, as a design goal, being dynamic and flexible over static and fast. So it could happen, but it would require a lot of work. In theory if ruby "just had a faster VM" it could approach the speed of some of the static languages (Rubinius for example has very quick method calls, thanks to its JIT). So that brings it "closer" to the speed of compiled languages but it will probably never be as fast as them without adding some typing information. That being said, there are some "ruby like" languages that attempt what you describe which may be of interest to you. Specifically mirah, scala, and clojure somewhat. There have also been some experimental attempts at optimizing ruby in the past, such as ruby2c, but they haven't gained too much traction. It would be interesting to work on ruby-like "converters" for language (ex: ruby to mirah), but I haven't found time for much of it. Diamondback ruby (http://www.cs.umd.edu/projects/PL/druby/) also was an attempt to use static analysis to look for bugs in ones code. It might be interesting to you. Cheers! -r