Xen and the Art of Objects and Data
Erik Meijer from Microsoft Research is working on a new CLR language that incorporates C#, XML, and relational data.
I first read about it in an Extreme Tech article, which had this little code snippet:
public class book {
sequence{
string title;
choice{
sequence{ editor editor; }+;
sequence{ author author; }+;
}
string publisher;
int price;
}
attribute int year;
}
Looks a lot like C#, right? The sequence, choice, and attribute keywords are from XML usage (in XSD) and the + means “One or More“ (there is also ? for optional, and * for zero or more). There is also parts of the syntax that allows for iterating over collections using a type of query.
book* OldBooks =
bib.book[it.publisher == "Addison-Wesley" && it.year > 1991];
In the above example, it is an implicit iterator and publisher and year are attributes of the items in the collection.
Note, this is the opposite approach from tools like O/R mappers and XSD.exe which attempt to hide the differences from the programmer. We've seen a similar evolution in the way we think about invoking objects across the network. Tools like DCOM and .NET Remoting attempt to hide the RPC and make it appear as a local call. But as the thinking evolves, tools like Indigo is designed to make the boundaries across apps and machines explicit. Initial thoughts on data access were to make it all look like objects (i.e. O/R mapping). But as the thinking evolves, maybe we need to make the boundaries between objects and data explicit (and easy) as well.
See also: Unifying Tables, Objects, and Documents (Erik's paper)