I’ve finally begun my long overdue introduction to LINQ. It’s too early for me to comment in any meaningful way on LINQ as an enhancement to C#. But I will discuss what I think is an interesting trend in C#’s evolution as a language - syntax enhancements for BCL types.

I admit this is a strange thing with which to concern myself. C# and the BCL have always had a reciprocal relationship. The common type system helps to tie language and library together by way of int, string and the like. I certainly have never found it odd that C# gives special language support to strings, even though the String class is just another type in System. But when C# introduced the ? to turn an int into a Nullable, I started to notice just how closely C# is tied to the libraries that support it.

The using keyword is another example. IDisposable is a language dependency. A foreach loop binds System.Collections to the language specification. LINQ takes these macro-like language enhancements to a new level. Now a query language is baked right into the language itself. LINQ’s language features are just syntactic sugar on top of the LINQ API. Additions such as extension methods, properties and anonymous types might also be considered compiler candy, but these features feel more local to the language.

It looks like C# as a language will continue to evolve by adding both novel features and API-wrappers. As this coupling continues, it will be interesting to see what constraints are placed on the language. Could C# with all of its BCL macros ever effectively be ported to run on the JVM? Will the C# language itself one day become extensible to allow direct support for DSLs or commonly used APIs? Will the language have to devolve to remove features that apply to only defunct APIs?