From the Microsoft Research:
Comega is an experimental language which extends C# with new constructs for relational and semi-structured data access and asynchronous concurrency.The preview download includes Cw command line compiler, Visual Studio .NET 2003 package which extends VS.NET ti support Cw (really nice integration) and lots of samples. Cw supports XML as native data type, so you can write something like
Cw is an extension of C# in two areas:
- A control flow extension for asynchronous wide-area concurrency (formerly known as Polyphonic C#).
- A data type extension for XML and table manipulation (formerly known as Xen and as X#).
// This class returns the sample bib.xml data as the above Comega objects. public class BibData { public static bib GetData() { return <bib> <book year="1994"> <title>TCP/IP Illustrated</title> <author><last>Stevens</last><first>W.</first></author> <publisher>Addison-Wesley</publisher> <price> 65.95</price> </book> </bib>; } }And what's more interesting - Cw partially supports XQuery-like constructs natively:
public static results RunQuery(prices ps) { return <results>{ foreach(t in distinct(ps.book.title)) { yield return <minprice title="{t}"> <price>{Min(ps.book[it.title == t].price)}</price> </minprice>; } }</results>; }Online documentation is available here. I wish I had some spare time to play with it...
Leave a comment