Here’s a teaser screenshot:

Media_httpstaticflick_gvkbo

The integral was defined by this Ruby code:

integral('a', 'b', 'f(x) dx')

The image that you see was rendered using the technology formerly known as Avalon. This is a part of the new sample application that will ship in the 3rd drop of RubyCLR (probably sometime tonight, or whenever I get enough time to type up a set of release notes). It will let you interactively create mathematical expressions in an Avalon application.

I used Valentin Iliescu’s most excellent Math.Equations library to do the heavy lifting. Most of the equations that you see are really custom layout panels. Valentin graciously agreed over lunch to let me ship his assembly (only 45K) along with RubyCLR so that you can see this stuff in action.

The domain specific language that I created for this sample is far from ideal; I gave myself a 1 day time window to create this sample, and I’ve run out of time. If anyone out there is interested in improving the DSL, go for it (and please share!).

Here’s an excerpt of the DSL that defines the paragraph in the screenshot:

text 'The first fundamental theorem of calculus states that, if ', expr('f')
text 'is continuous on the closed interval', expr('[a,b]'), 'and', expr('F')
text 'is the is the antiderivative (indefinite integral) of ', expr('f')
text 'on', expr('[a,b]'), ', then ', integral('a', 'b', 'f(x) dx = F(b) - F(a)'), '.'

You’ll need to have the February 2006 WinFX CTP to run the WPF sample (but you won’t need it to use any of the other code in the bridge).