Oleg Tkachenko's Blog

Visual Studio 2010 Release Candidate is available for download (all three editions - Pro, Premium and Ultimate) and I ask you to install it, give a try and more importantly - try your real projects on it. Why bother? Because you can help to make it the best Visual Studio version ever. 10 might become new 6, but these small nasty beasties like this one can spoil everything. It is not too late to fix crashes and other severe bugs we might have missed. The bug bar is very high now, but crashes in common scenarios and data loss issues still can be fixed by RTM, we just need to know about them ASAP.

The CLR has great support for dynamic languages like IronPython. Learn how the new Dynamic Language Runtime (DLR) adds a shared dynamic type system, a standard hosting model, and support for generating fast dynamic code. Hear how these features enable languages that use the DLR to share code with other dynamic and static languages like Microsoft Visual Basic .NET and C#.

IronRuby is a new dynamically-typed language for Microsoft .NET that offers more runtime flexibility at the expense of compile-time verification. Find out why this is a good thing in the right situations: static compile-time verification for components that need additional rigor, and dynamic typing for more fluid parts of a program. See how to use dynamic typing to create internal Domain Specific Languages (DSLs) and how to use them for systems that you create.

I also added a bit controversial recording feature. I now record everything users type there for security and research purposes. Security - because "Try IronRuby" is hosted on a shared ASP.NET hosting and if somebody crashes it I need to know how it was done to prevent it in the future.

Funny thing - when I started recording I added a disclaimer below the console:

Your Ruby code might be recorded for research purposes. No personal data (such as IP address) is ever collected. View what others typed here.

Immediately a concerned user with name "Life Liberty Property" posted this comment:

While the Try IronRuby piece was cool/fast, the fine print underneath concerns me.

It shows signs that Microsoft doesn't get it, their shills don't get it, M$ and cronies refuse to change, they think they own everything, and they are no more open than before: "Your Ruby code might be recorded for research purposes"

Do I have to study in detail the MSPL, too, to make sure they don't own everything I write?

Man, my trust surely wasn't earned today.

You mean that somebody is already trying to take code that isn't theirs? Get a life.

Obviously Microsoft forgot about XInclude when they were shipping Visual Studio, so when you edit your XML and use XInclude you get no intellisense. It's easy to fix though. Just get this XInclude schema (standard XInclude schema improved a bit by Laurens Holst) and drop it into

Very cool talk by Steve Yegge, available in video or transcribed form. I particularly enjoyed tooling part:

Moving right back along to our simple dynamic languages, the lesson is: it's not actually harder to build these tools [for dynamic languages]. It's different. And nobody's done the work yet, although people are starting to. And actually IntelliJ is a company with this IDEA [IDE], and they... my friends show off the JavaScript tool, you know, and it's like, man! They should do one for Python, and they should do one for every single dynamic language out there, because they kick butt at it. I'm sure they did all this stuff and more than I'm talking about here.

I'd add couple more modern IDE tools supporting dynamic languages: NetBeans (Javascript/Ruby) and Visual Studio 2008(Javascript, IronPython via IronPython Studio). But Steve is completely right - this is just the beginning.

Anyway, I decided why don't I build IronRuby version of the famous "Try Ruby in your browser" by _why? So anybody with 15 free minutes at hands could play with IronRuby. That sounds like cool way to learn IronRuby internals.

A very little known fact is that Visual Studio 2008 does support real XSLT intellisense - not a static XSLT schema-based one, but real dynamic intellisense enabling autocompletion of template names, modes, parameter/variable names, attribute set names, namespace prefixes etc.

For some obscure reason it is off by default and obviously completely undocumented. I'll show you how to turn it on. But before - a little teaser.

1. When you about to call a named template you are presented with a list of all named templates in your stylesheet. My favorite feature. Finally you don't have to remember all your template names:

2. In XSLT template parameters are passed by name, so when you call a template and want to pass parameters you actually have to know exactly what parameter names are. And you better know them for sure, because if you make a mistake you pass a parameter with wrong name you get no error or even warning. XSLT 1.0 specification allows such nonsense. That's why template parameter name autocompletion is a real time saver:

3. You can pass parameters when applying templates too. Obviously due to dynamic XSLT processing model it's hard to know in advance which template will be matched at run time, so it's hard to suggest list of parameter names. In this version of XSLT intellisense we get list of all parameters used in all templates, filtered by mode. I believe XML Tools could optimize it a bit by filtering the list when it's clear from the context which template will be matched. Anyway, very useful:

4. Autocompletion of template modes is also extremely useful. Make mistake in mode name and you can spend hours in debugger trying to figure out why your template isn't matched, because again this is not an error or even something wrong according to XSLT spec. That's why this is so cool:

and <xsl:namespace-alias> (mostly used for generating XSLT using XSLT):

6. If you use <xsl:attribute-set> elements, you will be happy to see this one:

These are autocompletions I'm currently aware of. There might be more - it's currently completely undocumented and I probably the first one writing about this feature. For example key names are collected too, but I haven't found where they are used. If you happen to discover another XSLT autocompletion, report it in comments section please.

Recent Assets

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion.