Several weeks ago I met with Sean McDirmid from the Microsoft’s Research and Prototyping facility in Beijing to chat about IDE design and his recent projects. Sean is a well-known researcher with broad interests in languages, compilers, and, recently, WPF and graphics. He was demoing the (open-source) project he’s working on now: http://bling.codeplex.com. Here are some quotes from the project’s website:
Bling is a C#-based library for easily programming images, animations, interactions, and visualizations on Microsoft's WPF/.NET. Features include:
Essentially, they use a similar trick to what F# did with Units of Measure – they leverage the type system to represent strongly typed “units”, wrap types such as System.Double and Point using implicit conversions and use operator overloading, extension methods and more to create an expressive DSL for representing constraints, math formulas, etc. directly within the host language (C#). Bling also makes heavy use of expression trees to do intraspection and meta-programming – using C# expressions to capture the formula as opposed to capturing the value. After a quick glance at the source code, I also notice some DLR usage and code-generation techniques.
What can we do with it? Well, Sean mentioned that this is great for rapid prototyping in C#, without ever using XAML. This framework is somewhat different from the WPF style, but it definitely looks interesting and champions what I think is a great collection of coding tricks cleverly combined into DSLs. Also, if you download and build the demo, it’s REALLY IMPRESSIVE. I don’t know about you, but I just love those eye-candy demos with bright colors, animations, gradients and other effects.
Here are a couple screenshots for a start. For more, take a look at the Bling tutorial.
Have fun!