[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small time coding [Was: Re: About Visual Basic [Was: Industry versus academia]]




On Tuesday, March 11, 2003, at 07:18 PM, Anton van Straaten wrote:
> On the language design side, one interesting technical point about VB 
> is
> that it has *optional* variable type annotations.  Prior to VB.NET at 
> least,
> typechecking was still dynamic, not static, but the optional 
> annotations are
> nevertheless a useful capability, which would be nice to have in some 
> of the
> other dynamically-typed languages.
>
> In many ways, having optional type annotations in a dynamically-checked
> language is an easy and useful compromise between static and dynamic 
> typing.
> And as Guillaume pointed out, it provides benefits for the tools.  The 
> tools
> can - and do, in VB's case - perform static type detection, even if the
> compiler doesn't.
>
> I think these optional type annotations are one example of a sort of
> pragmatism that's often lacking in language designs.  It's a pretty 
> low-cost
> feature to include in a language.  A trivial precompiler could add it 
> to
> just about any dynamic language - basically, find every mutation of a
> variable and insert a type assertion based on the variable's 
> declaration.
> But it seems that when people think type annotations, that leads them 
> to
> think static checking, and that leads straight to the usual static vs.
> dynamic polarization.

Robby Findler's work on contracts sounds very much like what you're 
describing;  higher-order contracts are a big part of what make it 
interesting. I agree with you that for my purposes, this constitutes a 
"have your cake and eat it too" approach to checking.

The paper is available at 
<http://people.cs.uchicago.edu/~robby/publications/>

john clements