Building DSLs in VS

Last night, after the Turing Lecture, we hosted a FlashBoF on “DSL’s in Visual Studio”. Stuart answered a bunch of questions and gave a much more detailed demonstration of the new DSL Toolkit than we could show during the keynote. Here’s what I learned from the session:

  • Models are stored in XML files. The language designer outputs an object model and will eventually also output an XSD. For example, here’s a screenshot of the language designer from the DSL Toolkit we’re releasing. Inside the designer, I’ve got a sample UIP DSL (I hacked this up on my own, this is not exactly the same one we demoed yesterday). As you can see, there’s a PageCollection concept which contains Page concepts that have Name and Kind values. Page concepts also has a collection of Transfer concepts, which in turn have Label values. Generating an object model makes it easier to write tools that manipulate models. Typically, I’m anti-XML-Serialization but in this case – where we have a relative simple XSD – it works fine. I could also manipulate the model by accessing the underlying XML if I want to.
  • Code generation uses templates and looks a lot like CodeSmith or old-school ASP. You interleave the static elements of the generated code with blocks of code that access the model (via the object model described above) and generate the dynamic model-specific elements of the code. So I’m guessing that people using the codegen tools like CodeSmith will feel right at home with this toolkit.
  • In the current builds (which is to say later than the build that we’re releasing first – the first build doesn’t include any of the code generation support) we’re generating a single code file from a model. Eventually we’ll be able to manipulate multiple files from a single model. This is similar to how the Class Diagram works – add a new class onto the diagram and a new file gets added to the project, delete the class from the diagram and the file gets removed from the solution.
  • Not all models are used to generate code. For example, in VSTS the Logical Data Center and Virtual Deployment models don’t generate code. They are useful  because I can use them to validate the Distributed System Model which does generate code.
  • Someone asked about the implications of code coverage, profiling and test-driven development on a DSL-based process. Frankly, I don’t know but it certainly got me thinking. The general consensus was that we’re still in the bootstrap phase of making DSL-based development a reality and these are issues we’ll have to deal with as we move forward.

OOPSLA Welcome Reception

I called it an early night yesterday (which explains why I’m blogging this today instead of last night) but I did go to the OOPSLA welcome reception. Ran into Martin again who pointed me in Gregor’s direction. Gregor presented at TechEd last year and was one of the top five speakers in the architecture track so we chatted about doing it again at next year’s TechEd. (I also got a chance to meet EIP’s co-author Bobby Woolf). Then Martin introduced several other attendees:

We all stood around chatting for a good while. I learned quite a bit and now have to add a few books to my very long reading list. I hadn’t realized that SourceForge is a product in addition to being an OSS code repository. Actually, their aren’t exactly the same – for example SF.net is built on PHP/Perl/Python while SF Enterprise Edition is built on J2EE. As we all started to drift off, Mark mentioned that he appreciated talking with me since didn’t always talk in “glowing terms” about MSFT. Hey, we do a lot right, but that means there’s always areas we can improve on and I always err on the side of honesty and transparency.

OOPSLA Day 0

Day 0 is almost done. Like yesterday, it’s been quiet, but the foot traffic by the booth is improving. I missed the afternoon of the DSL Tutorial tracking down a shipment of JOURNALs that we are handing out at the conference. Martin Fowler stopped by to say hi and we chatted a while about the Architecture Advisory Board. He missed the meeting a couple weeks ago because of a communication screwup (i.e. I didn’t call him) but he’s looking forward to working with us going forward. Some one ribbed him for sitting in the Microsoft booth, so he pulled out his PowerBook (or maybe it was an iBook). I told him that since he like UNIX so much, we should install Services for UNIX on his Windows laptop. 😄

This is a very different crowd from TechEd – not better or worse, just different. Very heavy academic presence. I got a very interesting code visualization demo from an MIT grad student. Flipping thru the conference program, the vast majority of the speakers are from universities. The majority of the remaining speakers are from IBM and to a lesser extent Sun. There’s a small Microsoft presence among the speakers – primarily related to Software Factories. It’s interesting, however, that three of the six of the invited speakers this year are from Microsoft.

OOPSLA Day -1

When I blogged TechEd, I started on Day Zero, the day before TechEd officially opened. At TechEd, that day is used for preconfernce sessions as well as other meetings. At OOPSLA, there are two days of preconfernces – I arrived today but the conference doesn’t officially open until Tuesday with Rick Rashid’s keynote. I guess that makes today “-1″. So far, it’s very quiet around here. I’ve got booth duty until 5pm, but I doubt I’ll spend much time with attendees. There’s only about 15 attendees in the exhibit hall right now. All the booth staff are chit-chatting with each other or are working on their computers. I’m sitting with Ajay, a product manager from VSTS emailing, chatting and deailing with some last minute shipping issues. (My group has just had really bad luck sending stuff recently). Of course, I’m guessing most people are in their precon sessions. I stuck my head in Jack’s session on Generative Software Development and it was full. Tomorrow is the DSL Tutorial that Keith blogged about. By then, I’m thinking things will be in full swing.

Two Down, One To Go

It’s been quiet around here as the last three weeks of October are insane for me this year. Two weeks ago was Strategic Architect Forum as well as the second face-to-face meeting of the Microsoft Architecture Advisory Board this year (the first was reported in the February Architecture Center Update newsletter). I’ll have much more to say on the MAAB later, but having SAF and MAAB the same week is tough – I worked seven days in a row including four 12+ hour days.

This past week, I was in leadership training with a bunch of teammates and p&p folks. Spent quite a bit of time “in the circle“ with EdWard and Jim from p&p plus David, Chris and Javed from my team (note to self – lean on Javed to get a blog). The sessions were intense and I learned quite a bit. I agree with Norman (who was also in the training but not in my group) that we’re very fortunate to work for a company willing to invest so much in it’s employees. However, it was two more 12+ hour days and a total of six over nine days. That’s now I’ve started re-reading Software for Your Head, which seems to share many of the same learnings from the leadership training course. Maybe we can start using SFYH in practice in my team – last time I read it I was part of a distributed team working more as a collections of lone wolves.

Next week, of course, is OOPSLA in Vancouver. I’m driving up Sunday morning and working the booth in the afternoon. I’ll be there all week and in the MSFT booth off and on during the conference, so stop by and say hi. I hear you can get flu shots in Canada, so I’m worried traffic going across the border will stink. It’ll be a long week, but at least I get next Friday off.