Posted By: Charles | Jul 10th, 2008 @ 12:36 PM | 149,049 Views | 59 Comments
What's the C# team up to these days? Who's on the C# 4.0 design team, anyway? With the looming problem of manycore facing developers now and certainly in the near future (to a much greater extent - programming for 80 core (asymmetric to boot) processors, anyone?). I thought it was time to find out what Anders et al are working on to get a clear sense of C#'s near (and not-so-near) future so I asked if I could come to one of their design meetings to have an informal chat (are we ever formal on C9?) and meet the people behind the next iteration of the most popular .NET programming language.

There are some new faces (and some old ones (not in terms of age, mind you Smiley). As expected, merging functional constructs into imperative C# are still top of mind for the C# design team. Here, you'll meet some new programming language gurus and some old time Niners (you'll recall the great Eric Lippert. He was in fact the very first developer we interviewed for C9 back in 2004 - even though his was not the first interview posted, it was the first one shot and the one where Lenn, Jeff, Scoble, Bryn and myself looked at each other and said "wow, we are on to something here!".).

C# 4.0 will contain many new features that will help developers be, yeah, you've heard it before, more productive. There's also some very interesting work going on with adding dynamic constructs to the language, which is of course very interesting given the static nature of the C# language.

In this video you will not get any specific details since the C# team wants to reveal exactly what they've done at PDC 2008. That said, you'll still get a very clear sense of what they've been up to and where they're taking the language.

It's always a pleasure to chat with Anders and team. I think you'll enjoy this one. On a personal note, I was coming down with a cold during this interview so please excuse the asking of the same question more than once (though in a different context). Oh, the joys of cold medicine. You know, the same stuff Lenn was on when he conceived the idea of Channel 9 several years ago.
Rating:
22
0
wil2300
wil2300
Super #
Charles, that is a good point about libraries vs. language constructs.  I assume that we are still a little ways from C#4.0 and in the mean time, the TPL library is being consumed and improved. Given that Joe Duffy and Anders seem to talk all the time, then it seems that the TPL library will provide a good test bed for parallelism, which, if successful, can be implemented in the next c# version. I mean the framework exists and not just for c# but LINQ as well. Anyway, just my 2.5 cents.
Charles, when you're interviewing them next time, it would be great if you could delve into the "intersection" between meta programming (which they said they were working on) and dynamic compilation of code (which they also talked about).
It sounds like there's an exciting opportunity here to combine those two and get run-time specialization of code.

E.g. if you have a regexp matcher that takes a regular expression and a string and returns true if it matches, you could specialize the first parameter of that function for a specific regular expression (which isn't known at compile time, only at runtime) and then run that specialized version on ten million strings. The benefit is that the regular expression would get hard coded into the specialized version so that the matching doesn't have to "interpret" it each time. There's a cost involved in doing thie specialization, but quite often you'll use it so often that the benefit outweighs that cost.

Seems to me like compilation can be viewed as basically the act of "baking in" known facts about your code (e.g. the size of a variable) into machine code so you can execute it faster. Well I'd say that many applications will have "known facts" that may not be true for the entire duration of the program, but will at least be true for "long enough" that it's worth baking them in anyway. Another example is an image filter, where you take the filter kernel and compile it down into machine code and then run it over the image (because the kernel won't change for the duration of the filter operation). A third example is a game where you load a game level, that level won't change for several minutes at least so it would be cool if you could "bake it in" and do all sorts of optimizations under the assumption that the game level is "constant" for some duration of time (e.g. inline calls that are virtual, but since the data is constant you know exactly where you need to go, unroll loops, recursion, do standard constant folding etc.).

Anyway, this is my pet idea for a "killer app" where you'll see all C++ advocates gladly switch to C# for the increased performance, and if you have both meta programming *and* runtime code generation/loading you're basically almost there.
staceyw
staceyw
Before C# there was darkness...
I think the tpl works pretty well as an library already (from an perspective).  As Anders said; would it make more sense to bake in a "ParallelForeach" keyword in the language - what are you adding?  Not sure.  Linq needed this kind of sugar in the language to make is cleaner/easier to call the apis.  Not sure tpl, as it exists today, would benefit the same way.  Some new pattern (that will become obvious when we see it) will probably benefit from lang sugar.  I think the big win will be when the pattern becomes "parallel correct" by *construction - which would be a combination of lang features, patterns, compiler, and libraries.  I think a pattern of being correct-by- construction (e.g. Erlang) has the most legs.
Are you taking requests?

Here is my list: http://jrwren.wrenfam.com/blog/2008/05/15/c-vnext-feature-request/

Left out of that list is my request for an extensible literal system. We already have the wonderful TypeConverter system in the BCL. The compiler could use that and I could have extensible literals in the language. Short of that, just list and dictionary literals would be great.

Guys, for over a year now, I've been telling folks at Microsoft that what we want is language constructs that help you write less buggy code.

It should be obvious, but this is the thing plaguing software teams; we write buggy code and we spend a lot of time writing unit tests, physically testing, debugging, and doing formal code reviews -- all in an attempt to get rid of bugs.

C# 4 should add some constructs that help us write software with fewer bugs in it.

For me, this means integrating some of the excellent research done over the last several years by the Spec# guys. The design-by-contract stuff would help us rid our codebase of mistakes developers often make when working on large, complex, real-world software systems.

Great video, Charles!

With regards to the dynamic typing-static typing dichotomy, it is not either-or.  It is not only-but also.  We want not only the affordances of dynamic typing but also the assurances of static typing.  Type inference sorta fakes us out into believing that it provides this, but it's still static typing, and there are limitations to that approach that cannot be worked around until changes to the type system are made.

Java and C# have been around for a while, long enough to where people will grumble if you make too many changes to the language.  If it is impossible to make changes to the language without incurring "-1000" penalties, then maybe it's time for a new language (or perhaps an old one whose time hadn't quite yet come...) to step up and pave the way for programming language innovation.  Better ways of getting the job done is the goal.

I've been waiting for it too. Now I can't wait for the details to be announced on PDC Big Smile
staceyw
staceyw
Before C# there was darkness...

Sounds like your talking about F#.  Looks dynamic, but static types and a new language.

Microsoft Communities