Managed Lex and Yacc

Buried deep in the docs for v3 of the Visual Studio SDK is something called the Managed Babel System. Babel – in the context of Visual Studio – is the framework for creating language services for stuff like syntax highlighting, brace matching, and IntelliSense completion. As part of the Managed version of Babel, the VS SDK includes the Managed Package Lex Scanner Generator (MPLEX) and the Managed Package Parser Generator (MPPG). Online docs are pretty thin, but there are a few white papers in the additional documentation of the VS SDK install.

Interestingly enough, the white papers were written by John Gough of QUT’s Programming Languages and Systems group. John wrote Compiling for the .NET Common Language Runtime and PLAS has several interesting language projects including Metaphor and Ruby.NET. As you might expect for a group that focuses on languages on .NET, they have a managed version of YACC called GPPG available and John said at Lang.NET that they would be releasing a managed version of LEX “soon”. I’m thinking that QUT’s GPPG/GPLEX combo has been absorbed into the VS SDK and renamed MPPG/MPLEX. Unfortunately, my laptop power connector is broken, so I can’t verify this until Monday.

It’s not a Rosetta stone and the lex/yacc model is getting pretty long in the tooth, but I’m thinking at least Larry O’Brien will be interested in these tools.

Update: Apparently, this is somewhat old news, as per Aaron Marten:

The tools we’re including are called MPPG & MPLex (which stand for Managed Package Parser Generator and Managed Package Lexer). They are derivative works from the open-source GPPG/GPLex tools developed at the Queensland University of Technology.
[Managed Language Tools in Visual Studio 2005 SDK]

Gamer Card Plugin for WL Writer

In my last post, I wanted to include a link to my gamer card, showing the NHL 07 logo on it. It turns out that in addition to the “official” gamer card from Xbox.com, there’s also the MyGamerCard.net site which provides both image and flash versions of gamer cards. Since I’m using Windows Live Writer, and I hear it’s really easy to extend, I decided to throw together a plugin for inserting Gamer Cards. It was, as advertised, extremely easy. I spent more time laying out the dialog box than I did writing the code to interface with WL Writer.

The plug in provides basically five Gamer Card options:

  • Standard Xbox.com Gamer Card
  • MGC.net Gamer Card image with link to Xbox.com Profile
  • MGC.net Gamer Card image with link to MGC.net Profile
  • MGC.net Gamer Card image only
  • MGC.net Gamer Card flash movie

I’m interested in feedback and suggestions for future versions. MyGamerCard.net provides ten different Gamer Card styles (that’s my Gamer Card to the left) so that’s an obvious enhancement for another day. I’d also like to evolve the plugin into a “Smart Content Source”, which allows you to edit the content after it’s been created (like the default “Insert Map” option). Finally, I’m thinking of adding support for GamerScoreChart.com.

Download GamerCard.WriterPlugin.Setup.zip (142.41 KB) and enjoy. Let me know what you think.

Hawkeye on NHL 07

For those who don’t keep a close eye on my Xbox playing habits, I picked up NHL 07 last night. There are two hockey franchises for the Xbox 360: EA Sports and 2K Sports. I’ve been a 2K fan for several years, but I didn’t think much of their last effort on Xbox so I never bothered to pick the 360 version. Of course, EA Sports skipped the 360 last year so I’ve been without next-gen hockey since I bought my next-gen console.

Now there’s a new version of both major hockey franchises, just in time for the opening of training camps. Each has had an entire year to innovate, and it’s interesting to see where each title has spent that time. 2K Sports has created “Cinemotion”, which is an entirely new presentation system which is more like an “interactive hockey movie” than a TV broadcast.

NHL 07 Box

EA Sports spent their time on an entirely new control scheme called “Skill Stick”. Basically, while the left thumbstick still controls player movement, the right thumbstick controls the player’s stick. It’s taking time to get used to – hey I’ve only had the game a few hours – but so far I really like it. I was playing the XBLM Demo and scored on a sweet spinorama move with the skill stick. That pretty much hooked me on the spot. Most of the reviewers have singled out the skill stick as the reason for the generally favorable reviews.

Plus, EA picked Washington Capitals superstar Alex Ovechkin for their cover athlete. Barring awful reviews, I pretty much decided to pickup NHL 07 as soon as I heard that.

IDEA 2006

I saw from Bruce Sterling’s blog that he’s going to be at Idea 2006 next month in Seattle. Bruce is at or near the top of the list of “folks I’d like to chat with over a few good beers”. I saw him at ETech and have since read and thoroughly enjoyed both Shaping Things and Tomorrow Now. I wonder if I can make it to IDEA?

Python and DSLs

When I read Larry O’Brien’s post IronPython as a Foundation for DSLs, I had a strong sense of deja-vu. I went thru a very similar thought process when I discovered the early versions of IronPython were written in Python. I figured that meant Python must have some support that makes building compilers easier. Unfortunately, that doesn’t turn out to be the case. Python provides a standard module called parser which “provides an interface to Python’s internal parser”. That means that compiling Python is easy, but there’s no support for compiling any language other than Python.

I’ve been doing a little experimenting in this space. First, as I’ve written before, I’ve been playing with parsing expression grammars. Second, I want to take a close look at Metaphor from QUT:

Metaphor is a programming language with support for type-safe run-time code generation — a form of meta-programming. Metaphor is based on a subset of C# or Java and combines the imperative, object-oriented nature of these languages with the multi-stage programming constructs from MetaOCaml. Metaphor uses the static type system of multi-stage languages to achieve compile-time safety of run-time generated code…

Metaphor is implemented as a compiler on the Microsoft CLR.

Finally, I need to take a closer look at ANTLR. Don’t know how I missed it, but I had never seen ANTLRWorks until Larry linked to it.