- Pedro on the Code Generation Conference
-
Pedro Molina has blogged about his experience at the code generation conference in Cambridge. Pedro was one of the folks with whom I had some great discussions, and his commentary on the conference is well worth reading.
- So what is a DSL anyway?
-
The term Domain Specific Language (DSL) is a popular buzz-word at the moment. If you look at wikipedia you’ll see the following definition:
“In software development, a domain-specific language (DSL) is a programming language or specification language dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique. The concept isn't new—special-purpose programming languages and all kinds of modeling/specification languages have always existed, but the term has become more popular due to the rise of domain-specific modeling.
The opposite is:
The problem I have with this definition is that it’s hard to draw the boundary between what is general purpose and what is domain specific. Instead, I prefer to think of a language having different dimensions, and to categorize a language we need to place it on each of the dimensions relative to other languages. This leads to a much more fluid categorization system, but makes it easier to identify the similarities and differences between languages. Below is a diagram I produced recently for a talk showing three dimensions. I think there are more, but these three seem quite important. I put some examples on the diagram to illustrate.
And as a tool platform vendor, I’d like to provide facilities for creating and using languages in as many points in that 3-dimensional (though probably should be n-dimensional) space as possible. I also want to provide ways of moving between languages at different points in the space.
What might other dimensions be? Martin Fowler makes the further distinction between internal and external DSL, so perhaps that might be another, though in that case I might concede that the dimension is binary: external xor internal, and no points between. Another might be formal/informal dimension.
- More from Code Generation 2009
-
Now I’m back from the conference, here’s an update on my first report.
Some highlights for me during the rest of the conference were:
- Seeing the second part of the joint keynote by Markus Völter and Steven Kelly, where they got to discuss views, cross-references and interaction between models. It felt good to finally have an answer for this difficult area with the new modelbus in VS2010 (see my previous post on this).
- A great goldfish bowl to discuss the question: does modeling = programming? We got as far as agreeing that executable modeling = programming, so programming was regarded as a subset of modeling, and that we need many of the tools we use for programming at the modeling level (debug and test models, anyone?). However, there was some discussion of whether there are some mdoels which aren’t programs (I argued that there were, giving examples such as business & performance models, models showing metrics for coverage, completion and so on), although conceded that these models indirectly influenced the eventual shape of the program. There is a bit of a slippery slope here, because then one could argue that they are part of the description of the program in some way, and therefore then part of the program. Mmm… all getting a bit philosophical for me. One nugget that did come out was the fact that modeling tools (at least graphical and forms-based ones) don’t let you model informally very well, and then incrementally change the informal to formal. You kind of get this for free with a text editor, because you can write pseudo code in comments and then step-by-step formalize that building as you go, until you get a successful build, at which point you can try executing the code which then leads you to a further step of validation.
- Lots of interesting conversations, including a discussion on code generation on the MSFT platform with Kathleen Dollard.
- Positive feedback received on the DSL Tools and T4 features we’re shipping in VS2010. Jean-Marc gave a session on this, which was well-received with lots of questions afterwards from folks wanting to know more. Folks particularly like the aforementioned modelbus. Indeed I came away with the general feeling that Visual Studio 2010 provides a solid, competitive platform and set of tools for those wanting to do model-driven development, whether it is from their own DSLs, from UML or some integrated combination of the two.
- Feedback received from a number of people, who have tried using both Eclipse GMF and DSL Tools, and who told me how much easier it was to build graphical designers using DSL Tools than GMF. We’re often told how hard it is to extend Visual Studio in comparison with Eclipse, but here is one area where it looks like we are some way ahead. I think folks will be surprised at the the new functionality put into the core Visual Studio platform in 2010, with the VS Extension Manager and Managed Extensibility Framework. We’ve exploited this already in DSL Tools, and have been working on exploiting it further to make the new Team Architect tools really easy to extend – but you’ll have to wait for the next preview after VS 2010 Beta1 for that. The new editor can also be extended using these mechanisms: see http://editorsamples.codeplex.com/.
[Added on 23rd June 2009]
I missed another highlight. There was a demo of Jetbrains Meta-Programming System (MPS). Although perhaps not for the masses, I thought this was conceptually very clean and nicely done. Great interactive session as well.
- IMS Locks Sample for VS DSL Tools 2010 Beta1
-
I see that Jean-Marc has just posted another sample on the DSL Tools Code Gallery landing page, this time about the new IMS Locks capability. This allows you to make some parts of your models read-only, which is good for situations where some users (say an architect) are allowed to make changes to some aspects of the model (say the core architecture components), and other users (say developers) are only allowed to make changes to other aspects (say the properties specifically focused on driving the code generators). As author of the DSL you have complete control in the locking policy used. More details in Jean-Marc’s post.
- News from code generation 2009
-
I’m at the Code Generation 2009 conference in Cambridge, which started yesterday.
Numbers are a little down on last year, but not much. Attendance is mostly from industry, with some academics. As usual it’s stuffed full of people with tons of experience in building code generators and languages to drive them.
I gave a talk yesterday which placed model driven development and code generation in the wider context of what I called the design cycle (see image below). Perhaps I’ll write it up as an article on this blog someday. I also illustrated this with a demo of some of the features of Visual Studio 2010, including the new tools for visualizing existing code through graphs.
Interesting panel yesterday on migrating to model driven development. There is real, concrete data out there which demonstrates the productivity benefits of an MDD approach. Why is it, then, that everyone isn’t doing it? Lots of discussion, with the top reason being social and cultural issues. It was also suggested that tooling isn’t good enough for broad use.
I’m sitting in the keynote which has an interesting format: the two invited keynote speakers (Markus Völter and Steven Kelly) decided to join forces and give a joint talk spanning the two sessions. I like it, especially when the speakers argue (e.g. textual DSLs, which Markus favors, versus graphical DSLs, which Steven favors; actually they concluded that a platform which integrates and supports both would be best).
- ModelBus Adapters Project Template
-
Jean-Marc has just posted a ModelBus Adapters project template on the Visual Studio Gallery. This template makes it easy to a modelbus adapter and adapter manager to your own DSL, which exposes your DSL for reference and access from other DSLs. This compliments the sample recently posted, as described in my last post.
- DSL Tools VS2010 Beta1: ModelBus Sample
-
One of the most common asks from customers of the DSL Tools has been support for integrating models and designers, that is the ability to have models of the same or different DSL cross-reference one another, and the ability to write simple code that exploits these cross-references to implement interesting interactions between designers.
In VS2010 we’re providing this support which can now be previewed in VS2010 Beta1 release. Jean-Marc has just posted a sample (StateMachineOverModelBus.zip, documentation) that illustrates how the modelbus can be used to achieve the behaviors described above, and I’ve just posted a short video demonstrating the behaviors and giving a quick insight into what you need to do to realize them in your own designers.
Details on how you can provide feedback can be found on our the DSL Tools Code Gallery landing page. Or by all means provide feedback on this blog.
- Much simpler deployment of DSLs in VS2010
-
In Visual Studio 2010 you’ll find a new extension manager that makes it much easier to package and deploy extensions to Visual Studio. Pedro has more information: Early Buzz on the VS SDK and Extension Manager, Introducing VS Extension Manager.
We’ve exploited this to deploy DSL Tools. Gone has the DSL Setup project which used WiX to create and MSI. Instead, a DSL authoring solution builds a VSIX package and uses that to install the DSL in the experimental instance of Visual Studio. But even better, to install the DSL in the main instance of Visual Studio, all you have to do is open the VSIX file in windows explorer and respond to the prompts. Restart Visual Studio and your DSL is installed! How easy is that?
I’ve captured all this on video.
- Speaking at Code Generation 2009
-
I’m speaking at the Code Generation 2009 conference in Cambridge in June on the topic of Code-Centric or Model-Centric – Approaches to developing software.
Jean-Marc is also speaking on What’s new in the DSL Tools and T4 in Visual Studio 2010.
I’m really looking forward to going to this conference which is at the cutting edge of model-driven and code generation techniques. It will be great to meet up again with folks I haven’t seen for some time, especially colleagues I used to work with before I joined Microsoft.
And beware: “LATE BOOKING FEES APPLY FROM JUNE 1ST”
- T4 Roundup
-
Gareth has been posting a lot about T4 over the past few months. In case you missed it, here’s a roundup of all his posts, in chronological order. Lots there to get your teeth into.
You can now try out the VS2010 features mentioned above with the release of VS2010 Beta1, VS2010 SDK Beta1, and VS2010 DSL SDK Beta1: see Dsl Tools for Visual Studio 2010.
I’ll also add one more link:
As you can see, T4 is getting popular!
And for VS2010 there’s more to come on top of the features that Gareth describes. Not available in Beta1, but in Beta2 we’ll be providing support for accessing models in T4 via the modelbus. This will enable text templates to access models created with the new UML designers in Visual Studio and more enterprise-scale orchestration of code generation.
- Migrating DSLs to VS2010 Beta1
-
When we released DSL Tools for VS2008, the migration story from VS2005 was not great: basically we provided a sheet of manual instructions which led to a fragile and long-winded experience. This time we’ve done a lot better. In the VS2010 DSL SDK Beta1 you’ll find a migration tool that converts your projects and solutions for you automatically. We’ve been using this internally to convert samples, test projects and so on, and it does a lovely job. There are links to a video showing the tool in use, and some documentation on the Downloads tab of the DSL Tools Code Gallery. Life is good.
- DSL Tools for Visual Studio 2010
-
It seems that my blog entries and those of some of my colleagues (Steve, Jean-Marc, Gareth) are like London buses: you wait for ages and then three come at once. And I’m definitely the worst offender – that bus which breaks down all the time.
Anyway, the reason why we’ve been so lax is that we’ve all been desperately busy getting Visual Studio 2010 out the door.
So it’s really exciting to announce the availability of DSL Tools for Visual Studio 2010 Beta1, hot on the heels of Visual Studio 2010 Beta1 itself and the corresponding Visual Studio SDK. Jean-Marc has all the details. We have a page summarizing the new features.
Various members of the team will be following up with blogs and samples, and we look forward to your feedback: the good, bad and ugly (actually, I’m sure you’re all extremely eloquent, so I don’t expect any ugliness). We’ll keep you up to date through the DSL Tools Code Gallery page.
- Back with Team Architect
-
As Cameron blogged in Visual Studio Team System 2010 Architecture: Prologue, the DSL Tools team have recently moved back to Team Architect from the Visual Studio Platform team. We’ve been working increasingly closely with Team Architect since they renewed their focus on building VS modeling tools integrated using the DSL Tools. By moving back to that team we’ll be better placed to focus on three goals:
- Evolve the platform to deliver a better experience for users of tools developed on that platform, including seamless integration with other tools used for software development (particularly those in Visual Studio), and rich productivity features for example around linking and transforming models. The experiences Team Architect have in mind will place strong demands on the platform; we can work closely with the teams building those experiences to make sure we get the platform right.
- Evolve the authoring tools in the platform to make teams building tools using it more productive. This goes for teams inside Microsoft as much as for customers outside.
- Provide a seamless experience for customization of the tools that we ship, from lightweight extensions of UML, through to patterns of integration and transformations layered on those tools, through to the creation of whole new DSLs which can be used in isolation or un harmony with the other tools.
We expect to make progress on all three goals in VS2010.
That said, our sojourn with the VS Platform Team was time well spent. We understand a lot better the technologies and the direction of the core VS platform and, just as importantly, know the people in that team a lot better. DSL Tools is layered on top of that platform and, already in VS2010, we’ll be taking advantage of the integration of the Managed Extensibility Framework (MEF) into the heart of VS (see e.g. this post) and the technologies underpinning the Extension Manager.
- Teach yourself DSL Tools
-
Jean-Marc has just posted a lab on code gallery, which provides a fully worked, step-by-step example of creating a DSL from scratch. If you're new to DSL Tools, or want to teach others how to use them, then you may find this useful.
Nearly forgot the link. It's at:
http://code.msdn.microsoft.com/DSLToolsLab
- DSL Tools and Oslo
-
The Oslo modeling platform was announced at Microsoft's PDC and we've been asked by a number of customers what the relationship is between DSL Tools and Oslo. So I thought it would be worth clearing the air on this. Keith Short from the Oslo team has just posted on this very same question. I haven’t much to add really, except to clarify a couple of things about DSL Tools and VSTS Team Architect.
As Keith pointed out, some commentators have suggested that DSL Tools is dead. This couldn’t be further from the truth. Keith himself points out that "both products have a lifecycle in front of them". In DSL Tools in Visual Studio 2010 I summarize the new features that we're shipping for DSL Tools in VS 2010, and we'll be providing more details in future posts. In short, the platform has expanded to support forms-based designers and interaction between models and designers. There's also the new suite of designers from Team Architect including a set of UML designers and technology specific DSLs coming in VS 2010. These have been built using DSL Tools. Cameron has blogged about this, and there are now some great videos describing the features, including some new technology for visualizing existing code and artifacts. See this entry from Steve for details.
The new features in DSL Tools support integration with the designers from team architect, for example with DSLs of your own, using the new modelbus, and we're exploring other ways in which you can enhance and customize those designers without having to taking the step of creating your own DSL. Our T4 text templating technology will also work with these designers for code generation and will allow access to models across the modelbus. You may also be interested in my post Long Time No Blog, UML and DSLs which talks more about the relationship between DSLs and UML.