Future Types

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
Not everyone are prepared to admit the obvious, but types are helpful. But where is the world of types moving?
I like the notion of duck typing (and structural typing) as apparently found in VB9 (not a VB user). Structural typing is a pretty powerful notion, although it could perhaps be considered somewhat hazzardous. I'd like to be able to do the same in C# as well, saying something like "interface IDemand { Some thing(); }" and "void use(relaxed IDemand it) ...".
Then there's pattern matching (a wonderful concept), where a value is structurally matched on the set of possible values of the type. In C# there are enum's and switches, but enum's are like plancton in the ocean of types - not that powerful, can only define primitive values, can't be recursive and can't be type-parametric/generic and can't be used to guarantee exhaustive matching (case-checks). The F# pendent, Discriminated Unions, does have this added power.
A separate discussion is how far C# can be evolved before the added formalisms start making the language an ugly mixed bag, as opposed to a choherent language of synergistic constructs as in C# 3.0.
Where do you see C#, CIL, and other languages going in the future, with respect to typing?


More...

View All Our Microsoft Related Feeds
 
Back
Top