On Why C# 3.0 is Cool
I come from a Perl background so with my beloved first code love Perl being a dynamically typed, interpreted imperative language with functional and object-oriented elements thrown in for free, I was delighted to read that C#, a statically-typed pseudo compiled imperative language has not only object-oriented grammar/semantics/features but functional ones too as of C# 3.0. So hopeful was I that C# also got list comprehension but alas it has only a crude hack so that side effects are explicitly such. (i.e. the “out” variable modifier)
Then, while reading Miguel de Icaza’s blog, I came across a presentation on C# 4.0 by its chief architect and was surprised to learn that not only have they put functional elements into C# but they are planning on bringing in optional dynamic typing. This is kind of a converse to Perl6’s optionally static typing. It’s almost like these two languages are converging somewhat: perl6 is dynamically typed with optional static typing, supports named optional parameters, functional paradigms, runs on a virtual machine… C#4 is statically typed with optional dynamic typing, supports named optional parameters, functional paradigms, runs on a virtual machine… It’s even more interesting to watch Anders (C# architect) say things like “for x equals one to four, do blah” which make one wonder if he’s secretly a perl hacker inside.
Other cool, interesting C# things here and upcoming:
- Mono GTK runs on Linux, AND Windows and Mac OS X. It looks half decent on the latter two as well. Not that it matters much anymore but during my brief one year foray into Candy Land Where Beach Balls Roam Free and Wild (aka Mac OS X) one app that I really wanted back was Tomboy.
- Next major release of mono gets SIMD support
- Closures and lambdas (and their lambdas look half decent to use)