[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 the language design side, one interesting technical point about VB is
> that it has *optional* variable type annotations.  Prior to VB.NET at
> typechecking was still dynamic, not static, but the optional annotations
> nevertheless a useful capability, which would be nice to have in some of
> 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

The Curl language has optional type annotations.  Variables with undeclared
types are given the compile-time type of 'any', which is the supertype of
all other types.  Type checking involving anys is deferred until runtime
while that with other types is done at compile time.

> 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.

Not if you want to get compile-time type checking or any performance benefit
from your type annotations.  Supporting the 'any' type in Curl has not been
easy, but we feel it has been well worth the effort.

- Christopher