Joseph Guadagno

Rants, Raves and other stuff about ASP.NET development.

PDC 2008 Experience: Day 2: "Oslo" the language

What is "M"?

  • "M" is a language for definig domain specific models and textual domain specific languages (DSLs)
  • M domain models define schema and query over structured data
    • Values, Constraints, and Views
    • Natural project to SQL
  • M DSLs define projections from Unicode text to structured data
    • Rule based transformations
    • Grammar driven text editor integrations.

What "M" is not

  • An object-oriented language
    • No polymorphism, virtual dispath
    • "Is-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 schemes and values - not an OLTP solution
  • A replacement for T-SQL
    • Far less expansive feature set
    • Tool chain supports linking/invoking T-SQL

How it works

Model.M M.EXE Model.mx MX.EXE SQL
Model Compiler Image File Domain Model Loader  

Sample Model

contact.mx

   1: module Contacts
   2: {
   3:     People
   4:     {
   5:         { Name = "SEVDNUG", Age = 23 },
   6:         { Name = "Joseph Guadagno", Age= 21 }
   7:     }
   8: }

 

   1: module Contacts
   2: {
   3:     People:
   4:     {
   5:         Name: Text where value.Count <=28;
   6:         Age : Integer32;
   7:     }* where identity Name;
   8:  
   9:     People
  10:     {
  11:         Joseph = { Name = "Joseph Guadagno", Age = 38},
  12:         Deidre = { Name = "Deidre Guadagno", Age = 38},
  13:     }
  14:  
  15:     type Marriage
  16:     {
  17:         SpouseA : People;
  18:         SpouseB : People;
  19:     }
  20:     Marriages : Marriage*;
  21:  
  22:     Marriages {
  23:         { SpouseA = People.Joseph, SpouseB = People.Deidre }
  24:     }
  25:  
  26:     PeopleNamed(n : Text)
  27:     {
  28:         // People where value.Name == n
  29:         People.Name(n)
  30:     }
  31: }

People:  defines the types

People created the data

type Marriage defines a relationship

Marriages applies the relationships

PeopleNamed A function to print the names

Command line to compile it

   1: mx /i:contacts.mx /d:window /c /f

Domain Modeling Constructs

  • Extents declare storage fro values
  • Types constrain values in a given context
  • Explicit identity enabled references
  • Functions name parameterizes expressions.

The M Framework

  • M is implemented as M DSL
    • Parser exposed using M DSL machinery
    • Type flow exposed as framework component
  • SDK ships with an evaluator (MrEPL) that builds on both.

Where are we?

  • "M" is a textual moding language for defining domain models and textual DSLs in Oslo
  • "M" domain models based on values, views and constraints
  • "M" domain models have a natural projection to SQL
Posted: Oct 28 2008, 05:12 PM by jguadagno | with 2 comment(s)
Filed under: ,

Comments

gOODiDEA.NET said:

PDC PDC 2008 - PDC Pre-Conference: Concurrent and Parallel Programming - Microsoft PDC 2008: Day 1 Wrap

# October 28, 2008 9:24 PM

gOODiDEA said:

PDCPDC2008-PDCPre-Conference:ConcurrentandParallelProgramming-MicrosoftPDC2008:Day1...

# October 28, 2008 9:25 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)