Things in Metadata that are missing in Reflection

System.Reflection is a high-level way of describing Types in .NET targetted at managed code consumers. The API is easy to use, but does not expose all the information that’s actually present and affecting decisions. For example, Reflection does not expose TypeRef, MemberRef, AssemblyRef, or other Ref tokens.  These tokens are references to things in other…

1

Binary vs. Source compatibility

Binary Compatibility means that when something is updated, you continue to work without needing to even recompile.  Source Compatibility means that you need to recompile to keep things working, but you don’t have to actually change the sources. One is not a superset of the other. Here are some examples in each combo. Compatibility generally…

2

Do you compile XML to IL?

We need some customer feedback to determine if we fix a regression that was added in VS2008. Any language can target the CLR by compiling the language to IL, and then you immediately leverage the .NET platform, including access to the libraries and debugging tools. Do you write a compiler that takes an XML source…

16

Why are you caching data?

There are multiple reasons to cache data. For example, are you caching because of a performance issue of because of a correctness issue?  Know which, and comment it at the spot doing the cache.   If it’s performance, the idea is that you have some expensive operation, and you save the results so that you…


Why threading is hard

Anybody who says “I can write correct multi threaded code” probably should be saying “I don’t test my multi-threaded code”. It is very difficult to write correct multi-threaded code. One way to appreciate this is various “find-the-bug” pop quizzes that occasionally come up. Another approach that I’ll go after here is to look at the…

8

Quiz: can you count how many combinations …

Here’s a combinatorics quiz: If you have 2 ordered lists (lengths N, M), how many ways can they be interleaved into a single list while still preserving the partial ordering from the original lists? So if the lists were:List 1: A,BList 2: X,YThe following would be valid: A,B,X,Y A,X,Y,B X,Y,A,B A,X,B,Y But ‘ yxab’ would…

10

Lang.Net 2008 is coming

Lang.Net 2008 is coming up this Monday through wed (Jan 28th -Jan 30th). This is targeted at compiler and language implementers. The agenda is here and includes a lot of great Microsoft and non-Microsoft folks. In my former debugging life, my angle for these sort of conferences was from the debugger perspective. (Here were my…


Battle Simulation: size vs. smarts (part 3)

How much stupidity does it take to prevail over intelligence? I previously explored simulating Real-time-strategy battles with IronPython. (Part 1, Part 2). We saw that even with very simple rules, different strategies are better than others.  If two armies of equal size attack each other, a good strategy clobbers a bad one. In this entry,…

3

Battle Simulations with Iron Python (part 2)

I previously wrote about modeling RTS battles with IronPython. In this entry I’ll explore a new policy for attacking that was suggested on the last thread. Previously, I compared 2 policies for picking which opponent to attack: 1. Attack the weakest enemy.2. Attack a random enemy. Each turn (eg, after each round of shooting each…

2

Partial Classes and future-proof vindication

A common question is “How can my tool crack the PDB to automatically determine what source file / line number a .NET class is defined in?”  It’s a trick question. There’s a problem with the question. A .NET class may not be defined at a single source file / line number. How should you specify…