MGrammar and Rescuing the Princess

One of the major reasons that I decided to come to work on the Oslo team was the experience I had with what was going to become MGrammar. I was interested in prototyping some language and compiler design ideas, and I knew that the Oslo team had some technologies that might help me out, specifically a parser generator. They helpfully pointed me to their source code, I enlisted, built and started to play around. I’d been building some parser technology by hand, but I quickly discarded it once I started playing around with MGrammar in Intellipad. In addition to giving me a bunch of things that I needed, it was also just really. fun. I mean, it was cool to bring up a buffer, start hammering on a syntax and then put in an example and see the result pop up. Or, as was the case most of the time, not pop up. Tweak, tweak, tweak and then. boom! the result shows up.

This storyline is one that I’ve heard a number of times internally and even seen externally a time or two. People just have a great time playing around with grammars and languages and seeing what they can get to come out. There’s frustration, sure, but then there’s also a big payoff when you finally see it working-look what I created!

I hadn’t really thought a lot about it until I came across a presentation that Daniel Cook (author of the Lost Garden blog) gave at an OfficeLabs meeting entitled “Mixing Games and Applications.” He says it a lot better than I can, but I intuitively think that I (and others) enjoy fooling around with MGrammar in Intellipad precisely because it taps in to game playing part of our brain. I’m not sure how to capitalize on that further, but it’s interesting food for thought.

2 thoughts on “MGrammar and Rescuing the Princess”

  1. Paul, I have been playing with the Oslo tools as well, and I’m sort of underwhelmed. Especially with the MGrammar/Intellipad combo. My dislike of Emacs and my bias about VB-ish syntax are probably two reasons. Maybe I’ll come around after a bit more exposure.

    On the topic of tweaking and seeing results, have you ever seen a tool called Microsoft English Query? it used to ship with SQL Server 7. It allowed you to build semantic models, and generate SQL queries from them. It was amazing. I don’t know whether anyone on the Oslo team has seen that tool, but THAT was fun. I strongly recommend that the Oslo team take a look at it, if you can still find the bits. Probably on \boneyard if that still exists.

  2. Hi Paul. I’m addicted to playing with language and compiler design, and I know exactly what you mean by tapping into the game playing part of the brain. There’s a huge feeling of achievement with getting that stuff to work, in progressive levels of "unlocking" the next challenge.

    The work around parser generators in Oslo is phenomenal. I hope it includes Compact Framework to bring some parity of opportunity there.

    Do you know of any open source work or other examples of general purpose .NET languages developed with Oslo/Mg, including interpreation of the AST and generation of IL?

Leave a Reply