In recent days there’s been some interesting movement in Oslo-land:

  • Doug Purdy and Chris Sells did a presentation at Mix09 that showed a domain-specific language for invoking RESTful services, and how to use M to create RESTful services
  • BizTalk MVP Yossi Dahan has published (Part 1, Part 2, Part 3) details about his domain-specific approach to BizTalk deployments
  • Kris Horrocks has started blogging, and posted his domain-specific approach to interacting with X10 home automation

What these three things have in common is that this is the start of practical examples of how you can author a DSL using M, and how the DSL could be used to simplify the effort required to do things (ie: reduce the amount of code you need to write). Up until now it’s been interesting to watch, but there hasn’t been much in the way of practical examples. The fact that these are starting to emerge speaks to the increasing maturity of the project.

The path to learning this stuff starts with M, then you move on to creating DSLs using MGrammar, and then the final phase is creating a runtime that is actually doing something with the data produced by your DSL. This is where Doug and Chris’s presentation (I highly recommend you click the link above and watch it) really resonates well. The “Murl” effort they’ve been working on (available here) makes it really easy to create a REST client.

The sample also shows how extensible Intellipad is, by adding a new “mode” that enables actually USING the DSL (parsing *and* executing) from inside Intellipad and calling RESTful services. Very cool! The code you see below is the syntax of the DSL used to call REST services.

But, in my opinion, the most exciting part of their presentation was the MService part, which is a (work-in-progress, not released) way to create a RESTful service, using a DSL written in M. The screen shot below shows the service definition in the left-hand pane, and the generated SQL in the right-hand pane (red arrows indicates some of the relationships between the two).

They saved the file out to c:\inetpub\wwwroot, and made a REST request (from Intellipad, using Murl-mode, just because they could :)). There’s a handler that IIS routes the request for a “*.m” resource request to. It’s an entirely self-bootstrapped operation, if the service sees no storage it will create the storage.

M is all about writing down data, and the ultimate output is structured data in the form of MGraph. Where this becomes tangible and payoff is realized is when we use a runtime to do interesting things with that data, and MService is the best example of this that I’ve seen thus-far. It’s a tantalizing view of how developers will create applications in the future.

Technorati Tags: Oslo,M,DSL