From: Bill Atkins Date: 2005-12-11T01:44:31+09:00 Subject: Re: lib for optional static typing On 12/10/05, robertj wrote: > >The *real* question is where to get a type-system that is flexible > >enough to analyze non-runtime dynamic parts of Ruby without spraying > >class names all over. :-) > > that is certainly a point of view that many "typed" guys > would subscribe to. > the problem imo is not to define a "sound" typesystem > (as most static typing systems try to do and fail > regardless of the imense effort that has been put into) > but one that helps to define contracts on the borders of your > system without being restricting on the rest of the system. > > the only language i know that did an excellent job on that > was VB (classic) where you could work mostly untyped > (if you wanted and you did not care bout performace). > whenever you wanted to release a COM-object you had > to define the types. > this was a very pragmatic approach. > > ciao robertj > > > Common Lisp supports something like that. All values are dynamically typed by default (as in Ruby), but typing can be added to specific areas where you need it. The user can decide whether to have the typing used only as a compiler hint to get faster code, and/or to have it enforced so that an error will be signaled when an attempt is made to store an object of the wrong type into that variable. I'm not familiar with Visual Basic, but is it the case that all objects will eventually be COM objects? I was under the impression that they're pretty separate concepts. Doesn't seem that pragmatic if I have to change my regular code to a COM object just to get typing. -- Bill Atkins