Showing posts with label Oslo. Show all posts
Showing posts with label Oslo. Show all posts

Wednesday, October 29, 2008

First contact with Oslo

The first presentation about the language Oslo was by Don Box and David Langworty. It was really good to see that I don't have to know T-SQL anymore!

Why "M"

  • We want creating and interacting with oslo content to be simple and natural
    • Having a box-and-line design experience is an important enabler
    • Having a complementary textual experience is equally important
  • M is how we achieve the latter

What is "M"

  • "M" is a language for defining domain models and textual domain-specific languages (DSLs)
  • M domain models define schema and query over structured data
    • Values, constraints, and views
    • Natural projection to SQL
  • M DSLS define projections from Unicode text to structured data
    • Rule-based transformation
    • Grammar driven text editor integration

What "M" is not

  • An object-oriented language
    • No polymorphism, virtual dispatch
    • "ls-a" determined based on structural subtyping, not stipulation
  • A data access technology
    • M domain models compile down to T-SQL
    • Tool chain supports course-grained loading/unloading of schemas and values - not an OLTP solution
  • A replacement for T-SQL
    • Far less expansive feature set
    • Tool chain supports linking/invoking T-SQ

So Oslo is an abstraction on T-SQL and although it is not finished yet, it is already fun to play with. A little example:

First to start with a normal table:

Module Contacts

{

People

{

{ Name="persona", Age=29 },

{ Name="personb", Age=28 }

}

}

This actually means that we defined a schema and filled the table with two rows.

Next up constraints:

Module Contacts

{

-- Constraints:

People :

{

Name : Text where value.Count <= 30;

Age : Integer32;

}*;

People

{

{ Name="persona", Age=29 },

{ Name="personb", Age=28 }

}

}

What you see here is a constraint on the People table, which in T-SQL would look like this:

Create table [Contacts].[People]

{

[Age] int not null,

[Name] nvarchar(28) not null

}

It's still another language to learn, but I like this more then T-SQL.