Share via


Oslo M Language

The M language is awesome, I have been experimenting with it for quite some time now. it allows you to create models of types in a descriptive language. The idea behind M language is to capture developers intent in a descriptive language for modeling purposes. Additionally, it converts these types into SQL schema for application storage. Imagine if you have a type called Developer you could then create data for the types, write methods for the types etc. All of this will be automatically converted into T-SQL Tables, Views and Functions to be created in SQL Server. Once you have these tables and views, you can use any middle ware to write data to these views. In essence, you no longer need to create sql tables using sql management studio, just create the types in M language and you are good to go. M language syntax also supports LINQ expressions which could be used to write powerful methods which are created as functions in SQL. The following is a sample type, and attached is the SQL code for it which was automatically generated.

module CISGType
{
    type Developer
    {
        FirstName : Text where value.Count <=255;
        LastName : Text;
        ID : Integer32 = AutoNumber();
    } where identity(ID);
   

    Developers : Developer*
    {
        { FirstName="Anil",LastName="Revuru" },
        { FirstName="Anil", LastName="Chintala" },
        { FirstName="Mark", LastName="Curphey" }
    };
}

As shown in above example you can do bunch load of things with this, you could put constraints on the type members, auto generate identifiers, specify identity columns etc. Check the full list in M Language reference. Here are some more links for M language. If you want to get started look at the PDC 2008 video and download the SDK.

M Grammar in nutshell
M Language Reference
Oslo Developer MSDN Page
Oslo SDK Download
PDC 2008 OSLO video

Thanks
Anil RV