Tomas Petricek talks about C# 3.0 and the languages that led to many of its new features. The two languages that most inspired C# 3.0, F# and C-omega, are discussed in detail along with how the features changed as they moved from the research languages to C#.
F# is an impure functional language based OCaml of the ML language family. Tomas writes:
Functional programming in general were big inspiration for some of the C# 3 features and the F# research language already showed how these features can be implemented for the .NET platform. C# 3 includes constructs that were inspired by type inference (ability to deduce the type of expression), tuples (data types that represent pair of values), first class functions (ability to take function as a parameter and return it as a result), lazy evaluation (ability to evaluate expression only when it is later needed) and meta-programming (ability to manipulate with program source code).
C-Omega provides the other half of the LINQ functionality.
C-Omega is a language based on C# and it extends it in two most important areas. First area is better support for working with structured data (XML) and relational data (databases). The language extends type system of C# to include support for several data types that are common in relational and structured data and it provides querying capabilities for working with these data structures.
Topics covered by Tomas include First Class Functions, Type Inference, Lazy Evaluation, and Anonymous Types. Also covered is Meta-programming.
Support for meta-programming (however only very limited form) is one of the key features that enables the LINQ project and especially its implementation for working with databases called “LINQ to SQL” (previously DLINQ). When writing LINQ code that will be used for accessing to database, the expressions used for filtering and projection (as well as for other operators like joins) must be translated to SQL command and this couldn’t be done without the possibility to get the data representation of those expressions (therefore without some form of meta-programming).