I heard Microsoft developed a programming language called M
.
Can someone explain the use of M
and how a C# programmer can benifit from M
.
UPDATE 2:
In July 2015, Microsoft released a heavily revised version of M called Power Query. It is described as a "formula language", and is no longer about modeling per se.
UPDATE 1:
It's been almost four years since I wrote this, and my guess (that "it's not very useful") turns out to have been shared by a lot of folks. M is long since defunct and was never released. MS switched efforts to OData instead.
To understand the point behind M, you have to understand some brief history:
In the mid-1990s and the early 2000s, there was something of a mini-movement in software engineering to encourage business folks to write and develop software. This was seen as an effort to reduce the complexity of large software projects by cutting out the middleman of software developers for modeling large business apps. Many management teams loved the idea, since now business people could contribute directly to software development.
There were a lot of strategies that people used to try to increase business-analyst engagement. One of the more popular ones was model-oriented architecture. Under this scheme, business people could specify models directly using some kind of visual language (e.g. UML), which would then be generated into code. This would be not unlike having some kind of visual designer that created autogenerated database columns and tables as well as associated C# classes tagged with the right NHibernate tags.
Because it's inconvenient to learn a new programming language merely for the sake of modeling a few concepts, most business folks couldn't understand their generated code. Indeed, most folks just wanted to hand a stack of modeled code to developers and say "here, run with this". In general, the quality level of the generated code was low.
Ultimately, the movement died out once it became apparent that having business folks who couldn't understand the software they'd just written was problematic. The tools were partly to blame, too: slick boxes-and-arrows diagrams look great in PowerPoint presentations, but have ambiguous representations in software. The differences in intent between the possible implementations were often too subtle to capture in a tool.
This is where M comes in. Microsoft is betting that tools have improved to the point where it's now possible to model things more directly. They've obviously learned from the mistakes of others, since M is a textual language (rather than the slick boxes-and-arrows language of earlier visual modeling tools). Think of M as another version of UML, but with a lot of the cruft stripped away, and focused more or less exclusively on modeling objects (rather than sequences of events, actors, etc., and all the other things UML can be used to model).
IMO, it's not very useful right now because there isn't enough of a mindshare to make working with it effective. Part of the utility of a language is the tools it works with, and right now there are very few of those (actually, right now I can't think of a single third-party tool that helps you with M).
Sidebar: someone needs to give the Microsoft folks some SEO Marketing 101 classes. Zero of the top ten results for "m dsl" are even close to talking about DSLs: one result is for softball league in Detroit; one is about mobile phone digital subscriber lines; et cetera. Don't name your new tool after a letter of the alphabet!