Richard Thomason: TechEd Day 5

17 The Future of C# - Mads Torgerson

Mads described the main areas of change in future versions of C#. It will be more declarative and functional, like LINQ and F#, and say what you want to do, and not necessarily how or when or in what order. These features can also help with asynchronous programming. Also more effort will be made in the area of concurrency as we address the need to make use of all those cores in our future machines.

C# in future will co-evolve with VB. Where in the past, features were put in as separate language features, now more effort will be made to ensure features in each language are equivalent where it makes sense to do so.

There's now a Dynamic Language Runtime which brings the compiler features to the runtime environment, and contains compiler features such as a parser and expression tree management, dynamic dispatch (useful for COM). In the language itself, there's a new dynamic type which delays type checking until runtime. Mads demoed this by pasting in a piece of JS code and converting it to C# with a few changes.

C# 4.0 will have optional and named parameters, nicked from VB. Mark parameters as optional by adding = value in the function declaration, and use paramname: value to pass named ones. Named parameters must be passed last, after the positional ones.

Improved interop with COM has been a big priority. The ref keyword is now optional as many parameters are passed by reference because it was more efficient at the time to pass a pointer. Obviously if it actually gets written to, you need to put it in. Parameters previously mapped to object are converted to dynamic, and so casting is no longer required.

There's some stuff on relaxing return types from functions - safe covariance and contravariance. If you're a compiler geek, see http://andersnoras.com/blogs/anoras/archive/2008/10/28/c-4-0-covariance-and-contra-variance.aspx for more details.

After looking at what the F# guys are up to, no doubt, and realising that in order to support LINQ they need a lot of the compiler at runtime anyway, they got around to implementing a compiler support library which gives you access to all parts of the compiler. I guess if you felt the need you could write your own IDE. Ho hum, this makes it a lot easier to do an Equinox method language which emits C#. Mads demonstrated an Immediate window in a few lines of code, and it gives you an Eval function for free. Of course Equinox has been doing all this for years... Hehe.

18 Debugging performance issues, memory issues and crashes in .Net applications

This was a repeat session, and was unfortunately full up, again. I'll have to catch the video of this one. Time for some work on Support's urgent 4.20 issue.

19 Universal sign in using Geneva - Sam Devasahayam and Sidd Shenoy

In a distributed, multi-company, cloud-based environment, it is no longer appropriate or even possible to use AD for authentication as in the past. To address this and other problems, the Geneva project provides a server based solution which uses industry standard token based security to provide authentication and other information services. For reasons which are not clear to me, pieces of information held by the system are called claims.

This technology does not require code, and can be set up via wizards in a very similar way to AD. It can be used as a simple alternative to merging directories when two companies merge - actually it looks like a no-brainer in that situation, and since Cardspace also has a Geneva version, it looks like internet user login is going that way too. It turns out that Geneva is the son (daughter?) of Active Directory Federated Services and Cardspace.

There are programmatic APIs similar to AD.

20 Distributed concurrent enterprise software using REST - Arvindra Sehmi

I've been meaning all week to take a look at the Microsoft Robotics Studio, and this is my chance, as this seminar explains how people are using it not only for the cool stuff like flying unmanned aircraft and factory automation but also for business uses where there's a need for a coordinated messaging system across loosely coupled nodes.

More information, this session has been removed, so I'll have to go to Windows Embedded CE and Robotics instead.

Windows Embedded Compact is the robot and phone ready version of Windows CE which also runs on personal navigation devices. It's not Windows Mobile 6.0. I'm confused, but hanging in there. It features a .Net runtime targeted for the devices required, typically about 10% of the size of the PC framework, and providing 30% of the functionality. WE Standard is a tunable version of XP Pro which can produce a small footprint OS suitable for embedded devices, and there's a fully featured enterprise version. There's also Windows .Net micro which is an embedded hardware access .Net.

A CE robot is a programmable system of sensor and actuators, so pretty much any automated system is a robot by this definition. Olivier configured and launched a build of CE (which takes about 20 minutes) then went through the requirements of a real time OS in excruciating detail.

CE is deterministically scheduled, inevitably, which runs counter to most of the low level software I've encountered in the past. However it does appear that they've addressed this and have a reasonably sophisticated mechanism for handling interrupts. Interrupt management is what embedded software is all about, so I'm not convinced by the architecture of this product. However it's a nice idea to be able to develop in a high level productivity environment. Olivier explained the work they've done to minimise the effects of uncontrolled things such as garbage collection.

The Concurrency and Coordination Runtime handles messaging and locking, so simplifies inter-taask management. Decentralised Software Services access individual pieces of hardware and are managegd by an Orchestrator process. This is quite similar to ordinary Windows, clearly.

Olivier put together a simple demo using a robot that he made out of a hoover, an interface card and a tiny pc with a wireless card.