If you have been reading my e-mails for a while, you may have noticed that I often write technical “how-to” tips such as how to implement specific functionality in MPS, but seldom write about higher-level design questions like “how do I best design my language”.
In my experience, the work to develop a MPS-based tool is roughly 20 % language design, 40 % trying to have the editor behave the way the users want, and 40 % infrastructure issues: developing Swing dialogs, configuring the automated build system, and the like.
Thus, I don’t spend that much time on language design. It is of course possible to make a grave mistake during those 20 % of time. However, MPS provides migrations which make bad language design decisions not a big deal. Given the object-oriented nature of MPS languages, enhancing the metamodel is often easier than extending, say, a database schema.
Having said that, it is possible that I’m under the effect of the curse of knowledge as I write this. So let me list some resources related to analysis and design that I have found interesting in the past.
I consider language engineering to be similar to object or data modeling. If you read any book dedicated to modeling with objects or database tables, you will certainly pick up knowledge that will be useful for language engineering.
One of the first books I read on object modeling analysis was Martin Fowler’s very first book, Analysis Patterns. It contains examples of several object models from different domains.
In the similar vein there was The Data Model Resource Book series by Len Silverston. It presents several data models, again from different domains, with gradually increasing complexity.
In particular, one of Markus' articles, The Philosophy behind Language Engineering with MPS discusses the differences between the design of general-purpose and domain-specific languages.
Apart from reading, the best way to learn good language design is to simply experiment. Remember that undoing language engineering mistakes is usually not a big deal.
What language design resources have you found helpful? Reply and I will list them in one of my next posts.