Partially Typed Languages

There has been some discussion about StaticallyTyped languages vs DynamicallyTyped languages. Statically typed languages are felt to slow you down, but do offer another level of testing (and confidence in the code). Dynamically typed languages are easier to change, so you can go faster. There is less duplication (avoiding Rectangle rectangle = new Rectangle();). But mistakes can creep through (as is obvious by the number of web pages generating runtime script errors). The argument is that testing should make up for the lack of static typing in the language.

However, I think there is scope for partially typed languages. Or ones which are really strongly typed but are smart enough to not require all the syntactic overhead. For example SatherLanguage, which uses some TypeInference to avoid pointless repetition in declarations and initialisation. --AndrewSwan

There's also the approach of the TransframeLanguage, which has a freeze-melt mechanism (not the same as EiffelLanguage's) for converting parts of your code to and from static and dynamic types (and essentially between compiled and scripted code too). See http://www.transframe.com/transframe/papers/quest4.htm . Looking at this from a BigDesignUpFront point of view, you'd be appalled - its recreating the const-correctness problem all over the shop, as you need to make sure the types are all correct when you eventually 'freeze' the code. It also doesn't help at all with the duplication issue. However, when doing iterative development it can be a win to 'forget those checks just now, I'm trying to get the logic to work'.

Static types, and some other compile-time checks, are only partly about QA, and partly there as optimization hints - which you often don't want to care about while prototyping/refactoring. -- BrianEwins

These ideas have been developed in practice. MlLanguage and related languages have TypeInference, giving statically typed programs without explicit types. SoftTyping, mixing static and dynamic type checking, has been used for some time in LispLanguage and related languages like DylanLanguage and SchemeLanguage.


CategoryLanguageTyping


EditText of this page (last edited April 16, 2003) or FindPage with title or text search