DCSIMG
October 2008 - Posts - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

October 2008 - Posts

PDC Report: Day 3

Published at Oct 30 2008, 11:07 AM by pavely

In my previous report, I forgot to mention one more significant product update: Office. The next version of Office (“Office 14”) will have an online version, complete with the famous Ribbon and all major editing capabilities. In addition, synchronization services will allow nice, seamless sync between an online and offline versions, including the ability to open the same file by multiple users for editing with automatic or manual updates.

On with day 3!

Today’s keynote was by Rick Rashid, the head of Microsoft Research. After some general introduction to his division – MS research is one of the largest groups of researchers in the world, he showed (with help from others) some of the projects they’re working on. Definitely amazing and interesting stuff. Here’s one example, the World Wide Telescope project, which can be used online.

Session 1

The first session I went to was “parallel programming for managed developers in Visual Studio 2010”. The talk was very good and to the point, with good code examples. .NET 4.0 will have an abstraction of the low-level Thread class. The first is a Task class, that allows creating a hierarchical tree of jobs to be accomplished with built in ability to wait and cancel as appropriate. An even higher level abstraction over the Task types (there is a generic version for returning results, very intuitive) is the Parallel class, that contains various static methods, such as ForEach and For that can take a set of sequential tasks and automatically parallelize them.

Also, a ParallelEnumerable class contains extension methods that enable transforming LINQ expressions into parallel execution (PLINQ).

Session 2

After lunch, I went to a session that was renamed to “Direct2D and DirectWrite APIs” (it was simply called “new graphics APIs on Windows 7”, but after the “announcement” of the new D* APIs the true name of the session was “allowed” to be revealed).

This was (in the second part) a quick illustration of the new APIs for 2D and text rendering coming up on Windows 7. These are purely native COM APIs, much like the rest of DirectX. These APIs will have an implementation on Vista as well, probably around the time of SP2. The APIs are quite verbose, as all DirectX APIs are, but allow great control and increased performance as all is GPU accelerated if possible, falling back to software rendering if not. Even at software rendering it’s faster than GDI and as good looking (at least) as GDI+.

Session 3

The next session I tried was “Oslo, Repository and Models”. The previous talk I saw about Oslo was disappointing because of the wasting of time by the presenters with private and public jokes, which may be fun for the first 1 or 2, but become distracting and annoying later. Unfortunately, this session was also with two presenters (Chris Sells and Martin Gaudgin, both very respectable), but they too decided this is their chance at comedy, and did a simple M model with about 7 lines (including braces) in 35 minutes. That was the breakpoint for me and I left the session to try to acquire more shirts at the big Expo hall (and I did get a nice CodePlex training jacket, no just a simple T-shirt…)

Session 4

For the last session of the day, I decided on going to the unconventional and hear about the next version of the Windows Embedded OS (the current version is Windoes XP embedded), code named “Quebec”. The next version will have the Windows 7 kernel, with much simplified tools and procedures for creating the OS image than was in the Windows XP Embedded suite.

The surprise was that currently there was no way to get these tools to try them out, although the presenter did have some kind of version. A deeper query revealed that Microsoft does not even have an internal build to test the tools, nor do they have any timeline of availability. The Windows Embedded was not updated in quite a long time, and it seems Microsoft does want to continue this line of products, but that group is very dependent on the Windows 7 groups for availability and features.

Ask the Experts

This was the “Ask the Experts” evening, with all MS experts gathered in the great hall. Personally, in the development of the CLR Explorer tool, I’ve encountered a few issues and something that looked like a bug. I got a hold of one of the senior CLR developers that knows the ICorDebug* set of interfaces I was using, and I demonstrated the bug, which was an access violation reading what seemed like a NULL pointer. I handed him a crash dump of the process and was promised that this would be checked and if indeed a bug will be fixed for the upcoming CLR 4.0 version. At I did some good!

I also tried to get an answer to my logn standing question of why is WPF not exposed as pure native library, so I can use it without dragging the CLR and .NET framework? The short answer is “because”, which involves politics, managed code promotion and the idea that this is really in the DirectX realm and not WPF. Oh, well. I tried.

There were some more interesting discussion at “Ask the experts”. Maybe I’ll write about that in another post.

Last day of PDC is starting just about now…

PDC Report: Day 2

Published at Oct 29 2008, 11:48 AM by pavely

The day started with not one, but two keynotes. The first was led by Ray Ozzie, and much like his keynote on day 1, involved a bunch of other people, each one coming up to do their part before Ozzie closes the session.

The main topic was Windows 7. Some new features of the OS were demonstrated, such as improved task bar, automatic discoverability of printers and devices, and of course, the (multi) touch interface. Definitely nice, although still relatively costly hardware.

The road map was briefly presented, with no specific dates, but the hint was Windows 7 should RTM 3 years from Vista’s RTM (which was November 2006).

The live services platform was demonstrated, with some nice features allowing seamless connectivity across PC – phone – web with little effort. Impressing.

Scott Guthrie came up and showed some of the support of Visual Studio for developing for the Live platform along with some new WPF feature, mainly the introduction of the famous Ribbon and other new controls for WPF development, such as DataGrid, Calendar and more (some of them updated from a previous preview).

The second keynote was by Don Box and Chris Anderson, doing a double act with no slides, just code. Don Box is always fun to watch even if he does nothing. The chemistry between him and Chris is quite amazing – this is how a double talk should be – flowing, funny and with a lot of code.

They started out with a simple REST based service (the one developed in the previous PDC, they said) and continued to showing how to host it locally, but still find it through a hosted address, and then really deploy it to the Windows Azure cloud. All in all – a fun and informative session.

Session 1

After these two keynotes (and lunch) I went to see a talk on a somewhat obscure topic, the Concurrency and Coordination Runtime (CCR) and the Decentralized Software Services (DSS). These two technologies (DSS is built on CCR) were a part of the Microsoft Robotics Developer Studio (MRDS), but are completely separate and independent libraries that can be used outside Robotics.

Microsoft has decided to take these two libraries and create a “toolkit” that includes them both, with a hint that they may become part of the BCL in a future release of the .NET framework. I am somewhat familiar with CCR and wanted to hear more. The talk itself was not too bad, but ended after 45 minutes instead of 1:15. The CCR includes some new concepts that the presenter skimmed over way too quickly. Without the proper background, most of the audience was quite lost. There is a continuation talk today on this, I’m considering attending. Today the toolkit should be released. As I’m writing this, it is not released yet.

Session 2

I went to Don Box’s talk on the “M” language, which is part of the “Oslo” initiative. I always like Don Box’s presentations because they are at least funny.

He did this with another guy and they were swapping places (one talking, the other writing code or flipping slides), just as was in the keynote. However, the other guy was no match for Don and the session had some serious downsides (but was funny). This too was over in 45 minutes, which was really annoying. It could have been so much more. Basically, “M” is a new language (there’s a lot of that floating around) that allows description of data, with its structure and constraints. The *.m source files are compiled by the M compiler (m.exe) into some compiled form (*.mx) files, which can then be used to generate an SQL database that corresponds to the data. After that, various queries can be done against that data with T-SQL or LINQ.

“M” is a based for creating textutal DSL (domain specific languages), with tokenizing and parsing done by the “Oslo” framework. I’ll definitely tackle this subject in some later post after I do more research.

Session 3

The last session I went to was again somewhat on the outer rim, using Direct3D on the Windows 7 platform. I went with Tamir Khason, and we were surprised to find out that the session was switched to some more basic DirectX on Windows 7 session, with the “real” session moved to Thursday. Oh, well, we went in.

The talk was quite basic, with two new Direct APIs, Direct2D, to tackle 2D rendering (Direct3D has no direct notion of that) and remove or reduce the need for mixing the slow GDI or GDI+ calls. The second new element is DirectWrite, to tackle text drawing – again, something that was lacking in the traditional DirectX libraries, and replacing the basic features GDI provides.

Direct3D 10.1 is the basis on which Windows 7 runs. This API was redesigned so that not target game developers only, but other graphics based applications (compared to DirectX 9).

I’ll probably go to the “original” session on Thursday.

That’s it! The evening was spend in Universal Studios (the “party”). It was fun, especially “The Simpsons” ride!

PDC Report: Day 1

Published at Oct 28 2008, 02:23 AM by pavely

PDC has begun!

The keynote was started and ended by Ray Ozzie, with other supporting cast in between. The major thing coming out of the keynote was the cloud services based on Windows Azure (pronounced by most “Ajoor” with a French style J (like “bonjour”), but some other MS guy called it “azoor”). This is the operating system of the cloud, that was designed by two guys, one of which is Dave Cutler, the designer of Windows NT (and previously VMS). Cloud services are built on top of Windows Azure and deployed very easily to the cloud, where Microsoft’ servers and Windows Azure take care of scalability, load balancing, availability, etc., freeing the developer and the company from those burdens. Definitely a good idea for most people. Prices will be competitive, promised Ray Ozzie. The above link has the SDK (in a CTP release) and VS tools that you can download now.

Session 1

After the keynote, the first session I attended was titled “Advances in the .NET type system”, which was to tell something on the improvements in the type system for CLR 4.0 and .NET 4.0. It turns out that 2 main features were discussed, that arouse from the issue of carrying large COM interop assemblies when the app needs only a few interfaces and classes, a typical scenario when doing interop with Office applications.

When you interop with Excel or Word, for example, you must use the Primary Interop Assembly (PIA) of Office, thus increasing your code base by as much as 6.3 MB (for Office 2007). This is clearly undesirable as you might only want to use a few interfaces, so don’t need so many RCWs. The new /link switch to the C# compiler lets the compiler import types from the interop assembly and create local types (interfaces) with the same methods as are used. Unused methods are filled by dummy entries to preserve the Vtable method order. This eliminates completely the need for the interop assembly – very cool idea, and, admittedly – long time coming. The next part dealt with type equivalence between the local imported types and the original ones. The CLR is smart enough to treat them as one and the same if their GUIDs match.

The presenter was pretty bad, but the ideas were good. For the non-interop scenarios, interfaces and simple structs can be imported as local types, but must be “decorated” as COM entities by adding GUIDs and [ComImport], etc. Questions from the audience regarding security arose, as one could write a compatible interface and use it in place of the real one. The presenter and his aids had no good response, apart from “this requires full trust”, and they are still debating this…

Session 2

The next session I went to after lunch was “the future of C#” by Andres Heljberg, the language’s creator. His presentations are always fun, funny, and very informative. This was no different. He outlined some of the ideas leading to C# 3 and then described the new C# 4 features and even gave a small demo of C# 5 features further ahead.

The good features of C# 4 are default values and named parameters (a-la VB.NET). Finally, C# has it too.

Another feature concerns co-variance and contra-variance of collections and arrays (interfaces and delegates only). This allows, for example, to pass a string array as IEnumerable<object>, something that the C# compiler can’t accept today. I will probably address this feature in a future post more thoroughly.

The most controversial and interesting new feature was the possibility of calling dynamic code directly from C#, including calling COM code, IronPython (and other dynamic languages) and even JavaScript from C# directly, without any “glue” code.

Here’s a simple example. If I have an object reference and I want to call the foo method on it (assuming I know there is such a method), how would I do it? Today, I can do this with reflection, but this is definitely not natural:

void CallIt(object o) {

   o.GetType().InvokeMember(“foo”, …, o, new object[] { “hello” });

}

Some enum values are missing in the above snippet, but you get the idea. In C# 4 I can write:

void CallIt(dynamic o) {

   o.foo(“hello”);

}

A new keyword, dynamic, is introduced, that basically means “object” but the type is dynamic, that is, a binder must be used to translate the above code at runtime (or throw an exception) and call the method. Again, I’ll probably do a separate post on that.

The direction C# 4 and beyond goes, seems to be gaining dynamic language capabilities. This was somewhat frightening, as it seems C# 5 can do what Javascript can do (e.g. create properties and methods dynamically). How these features will be used or abused still remains to be seen.

Session 3

The next session I attended was on dynamic languages. This was a good session, talking about the DLR, and some of its features and how they are implemented. It was somewhat connected to the C# talk, as a trend is building to unify the static and dynamic languages, or at least to make them very good friends. I’ll probably tackle this issue in a future post as well (so many posts are building up).

Session 4

The last session I attended was on building and deploying a cloud service. The presenter, Steve Marx, did a fairly good job of demonstrating some of the capabilities of services running in the cloud. Although the session was more complicated than it should have, as he used the MVC framework and not traditional ASP.NET, that may have distracted some of the attention from the real issues. Clearly, he likes MVC.

Summary

All in all, it was a mixed day, with a mediocre keynote, one really bad presenter, but the day improved after lunch, although some of the new C# features are somewhat alarming, as static typing seems to be a bit neglected in favor of inserting dynamic types support.

Until tomorrow!

PDC Report Day 0: Pre-conference

Published at Oct 26 2008, 09:16 PM by pavely

The “real” PDC only starts tomorrow, but today was the pre-conference, meaning it deals with current issues and technologies, as opposed to the PDC itself, which mainly deals with future technologies.

Every attendee that signed up for the pre-conference day (an extra $400) had to choose a specific track, although technically you could switch tracks midway and no one would be the wiser.

Personally, I enrolled in the “Advanced Windows Debugging” track; although I know this stuff pretty well, there are always new things to learn, especially from experienced others. The presenters have written a book with the same name, from which I’ve read some. I was hoping the book will be used as a starting point and (at least the basic stuff) will not be repeated.

I was quite disappointed. The first session dealt with Debugging tools for Windows basics, like downloading, installing and later configuring symbols and a symbol server. Although important stuff, this can be done fairly easily by reading the presenters’ book or looking at the docs.

In the next session, the presenters showed how to look for resource leaks, specifically handles by using WinDbg and other supporting tools from the “Debugging tools for Windows” package. They showed very simple scenarios (with code samples from their book) that allowed them to demonstrate various commands (mostly !htrace)

The next session was about heap corruptions and was more interesting, with details on how the heap manager manages allocations and some ways of debugging them.

The next session was about Windows Error Reporting, which I personally found quite boring, although I can see the usefulness of this feature to organizations.

The last session was about managed code. Daniel did a simple demo of some SOS commands – pretty basic stuff. I think they were surprised (I was not) that many people were interested in managed debugging more than native debugging.

All in all, this day was somewhat disappointing – at least this track. Hopefully other tracks were better. More hopefully – the actual conference will be better!

Stay tuned for tomorrow’s report, here, live, from Los Angeles, CA.

Undocumented Helpful Command in WinDbg

Published at Oct 16 2008, 08:08 AM by pavely

When using WinDbg, one must type a lot… although the history (up/down arrow keys) is helpful, still…

An undocumented command, .cmdtree in WinDbg allows reading a formatted text file that creates a nice looking window with the command tree just waiting to be double clicked. John Robbins’ post explains further.

Here’s a sample file that can be used to create a nice looking command tree. it also includes SOSEX commands. Copy the file somewhere and then…

 

In WinDbg, type .cmdtree c:\tools\cmdtree-sos.txt and presto!

cmdtree

Operating System in C#?

Published at Oct 07 2008, 09:42 AM by pavely

Why not? Is that so unthinkable? Definitely the very lowest part of an OS has to be written in native C/C++/Assembler, but everything else can be written to run under the CLR (which is itself a native component).

Microsoft research has an interesting project, called Singularity. The project implements an operating system in C#. The project leaders say that a future Windows version (version 9) may be based on this concept, although it’s still a long way.

This is exciting news, at least for me – the idea to write a kernel device driver in C# can prevent many mistakes, which in kernel mode issue the famous blue screen.

Download and try!

Fun Day at Microsoft

Published at Oct 05 2008, 08:53 AM by pavely

ביום שלישי הקרוב (7 לאוקטובר) יתארחו מרצי ומומחי מכללת הי-טק במייקרוסופט ליום של צילומי סרטונים, בלוגים מרגשים ובעיקר הרבה XBOX…

אני מזמין את הקוראים (והכותבים) לדיאלוג (או מולטילוג) איתנו במהלך היום הזה על כל נושא שמעניין אתכם (ורצוי שיהיה קשור למייקרוסופט באיזושהי צורה) לכל אורך היום (חוץ מהפסקות אוכל ו-XBOX), לשאול, להגיב, להביע וכל דבר אחר שנראה לכם רלוונטי…

אני אישית מתכוון לעשות דברים בתחומים של LINQ, XNA, Silverlight ואולי דברים נוספים לפי הרצון ומצב הרוח.

נתראה בשלישי!