Avatar of marc

by

LINQ This!

March 15, 2006 in Elements

Brian and i have been of to one of the yearly CLR Compiler Labs at Microsoft this week, and one of the major focuses of the lab has been LINQ, a set of technologies planned for the next wave of .NET/Visual Studio “Orcas” that allows integration of query syntax into the core development languages.

LINQ was orignally introduced back at PDC05 and – to be honest – i haven’t personally given it much consideration up until now (beyond the cursory “yeah, we gotta look into that for Joyride”), but having seen the presentations by Anders and some of the other guys from the LINQ teams this week, i must say i am excited about the prospects.

It’s interesting to note that this technology will actually be relevant for two of our products, from two quite different angles:

Most obviously, we will of course want to support LINQ as first class language feature in Chrome, allowing you to leverage lambda expressions and query composition syntax right inside your Object Pascal code. There are still some Ts to dot and Is to cross in terms of what the syntax for Chrome will look like (as a matter of fact even the C# guys are still playing around with different approachs for theit query statements, as well) – in particular the definition of anonymous types will need some consideration.

On some fronts Chrome is actually already ahead of the field – for example, the C# team is introducing type inference and a new “var” keyword for version 3.0, because type inference forms a string basis for LINQ. Of course Chrome is already there, having supported this since version 1.0 ;)

Secondly, it will be interesting to look at adding support to Data Abstract for .NET as a full LINQ – or more specifically, DLinq – provider, making it possible to use in-langauge queries againt remote datasets from your DA server. Imaging writing something like

var customers = remoteDataAdapter.GetTable<Customer>();
var oldCustomers = from c in Customers
where c.LastSale < Threshold
select c.Name, c.email;
foreach (var o in oldCustomers)
SendReminderEmail(o.Name, o.Email);

where the query specified in your code would actully get packaged up, sent yo your Data Abstract server, to only return name and email fields of exactly the record you wanted to select.

I have actually been playing around with adding a prototype of this on top of our current DA4 (implementing in Chrome and consuming from the C# using the LINQ preview compiler), and it looks quite promising.

That said, LINQ is of course in its early preview stages; it’s planned for the “Orcas” release of Visual Studio, for which no official timeframe has been announced yet – so don’t expect any of this to become finalized or production-ready anytime soon. But we will stay on top of this this – on both the Chrome and DA front, so you can expect previews to pop up sometime in the Joyride and DA5 beta timeframe.

Yours,
marc hoffman
Chief Architect, .NET
RemObjects Software

1 response to LINQ This!

  1. Chrome Rocks! Delphi is the past!