DynamicDataTable, Part 2

The next thing we want for our dynamic DataTable is to do calculations between one or more columns. Imagine (for instance) that you want to add two columns and store the result in a third. In C#, the client code might look like this: dynamic table = new DynamicDataTable(t); table.Foo = table.Bar + table.Baz; At…

1

DynamicDataTable, Part 1

Let’s get started by doing “the simplest thing that could possibly work”. public class DynamicDataTable : DynamicObject { private readonly DataTable _table; public DynamicDataTable(DataTable table) { _table = table; } } For now, we’ll use a DataTable for the actual storage and a DynamicObject to provide an implementation of IDynamicMetaObjectProvider. What can we accomplish with…

2

DynamicDataTable, Part 0

To commemorate the first beta release of the first CLR to contain the DLR, I’m going to try to implement something more interesting than useful – a dynamic version of the DataTable class. My goal is to show how the dynamic support in C#4 and VB10 can be used to create a better development experience,…

1

Profiler Part II: Poor Man’s Code Coverage

The only feedback I’ve gotten so far about the IronPython Profiler is that it would be nice not to have to specify a command-line option to use it. Imagine that you’ve got a REPL open and are in the middle of some interactive development – something at which I think Python excels. You’ve spent a…

3

An IronPython Profiler

I was recently working on improving the performance of a Python-based application and thought it would be useful to profile my code.  My intuition was telling me that the problem was in a certain area of the code, but I wanted hard numbers to back up this intuition before I went to the trouble of…

2

C# Dynamic and Multiple Dispatch

I crashed Mads’ C# Tech Chat at Tech Ed EMEA in Barcelona on the grounds that the dynamic world has monkey-patched C#.  It was fun, and I had the opportunity to answer a few dynamic/DLR-related questions that Mads was probably more capable of handling than I was. One question that I choked on was whether…

1

DynamicObject

At PDC this year, both Anders and Jim used a helper “DynamicObject” class in their  demos.  This is actually a standard class in the DLR, which is why it’s in the “System” namespace. Unfortunately, DynamicObject didn’t make it into the CTP, and the version that’s in the Open Source DLR is newer than – and…

3

TechEd EMEA 2008

I’ll be speaking at a few sessions in Barcelona next week.  Of particular note is that the date, time and location of the “Microsoft Visual Studio Languages Chat” has been updated to fix a scheduling conflict.  See below for the details. TLA328 Dynamic in .NET: The IronLanguages and more. November 10 17:45 – 19:00 Room…

0

Viewing Emitted IL

Let’s say you’re working on a project such as IronPython or IronRuby that makes use of Reflection.Emit to generate code at runtime.  You’re probably used to seeing a stack trace in Visual Studio that looks something like this: Visual Studio will do its best to prevent you from viewing any part of that [Lightweight Function]. …

0

This… is… Dynamic!

Regarding our need to check-and-rethrow exceptions in IronPython, int19h asks “Shouldn’t exception filters do the trick without the need to rethrow explicitly?” That’s a good question.  In fact, I had the exact same reaction when I first started looking into this issue.  So I changed IronPython’s MSIL generation to use filters, and my updated version…

3