Free online function graphing with Silverlight

I see Jon Skeet has written a function graphing sample using DLR and Silverlight. It occurred to me that it would be very easy to create something like this using my Live Geometry framework.

So here it is: One difference is that I didn’t use DLR and Python, but wrote my own hand-written recursive descent parser for math expressions. One reason for this (except the fact that it was overdue for me to write a parser myself) is that I don’t think DLR will run on the Windows Phone 7 (since Expression.Compile() and Reflection.Emit are currently not supported on the phone). Also DLR is a bit on the heavy-side with > 1 MB increase of the .xap file.

Sources, as usual, at CodePlex.

Comments (7)

  1. RichB says:

    Log(x) looks very strange to me. ln(x) doesn't even seem to parse.

  2. Thanks, this is known. Logarithm has a singularity at 0 and not defined for negative numbers. I don't handle that yet.

    I've added ln(x) though (same as log).

  3. Curt Hagenlocher says:

    Tomáš has IronRuby working on the phone by taking advantage of the ET interpreter that's in the outer ring of the DLR. IronPython won't work on the phone, though — or at least not yet.

  4. GrayShade says:

    Zooming feels a bit weird, try x^4.

  5. Curt – that's awesome to know, thanks!

    GrayShade – thanks, I'll take a look when I get a chance.

  6. Chris says:


    Nicely done … it is neat to see how flexible Live Geometry is …


Skip to main content