Microsoft’s Eric Meijer spoke at QCon about “LINQ 2.0” in his keynote. So what on earth is LINQ 2.0? The name is probably inappropriate; he explained to me later that it is just a convenient tag for “what comes after LINQ 1.0”. Meijer started by talking about integrating relational concepts into languages; he didn’t say exactly what this would look like, but the idea is that you could specify relationships between objects, independent of the objects themselves. This is not LINQ 2.0 though; perhaps it is LINQ 1.1. LINQ 2.0 is about simplifying multi-tier, cross-platform web applications- hence the title of the talk, “Democratizing the cloud.”
So how do we do that? The starting point is that users want the same experience everywhere, irrespective of computer platform or device. Meijer’s idea is programmers should be able to code for the easiest case, which is an application running directly on the client, and be able to transmute it into a cross-platform, multi-tier application with very little change to the code.
That means a cross-platform runtime, right? Sort-of, but Meijer doesn’t envisage having to distribute a runtime engine such as .NET, the JVM (Java Virtual Machine) or Flash. Rather, he wants to use what is already available. Therefore he envisages .NET IL (intermediate language) binaries becoming a universally executable format. The runtime could be the CLR (Common Language Runtime), or the JVM, or the Flash player, or the browser. This would be transparent to the developer, because some intermediate piece would translate the .NET IL to JavaScript, or Java, or a Flash SWF. or somehing else.
This is a little similar to the concept behind the Google Web Toolkit, which lets you code in Java but translates your code to JavaScript. The idea is that you code in whatever language you like, provided that it compiles to IL. For deployment, some sort of cross-compiler does whatever is needed to run it. Maybe it gets converted to JavaScript, or a SWF, or WPF, or WPF/E; you are not meant to care. He calls this late-binding against the client runtime. Note that this is different from implementing the CLR on multiple platforms, though Microsoft is beginning to do this as well (WPF/E).
So that’s the cross-platform runtime sorted. What about the programming side? How do we make our single-tier VB.NET application into a multi-tier web application?
Meijer talks about growing the application organically using refactoring. His use of the term “refactoring” is wrong I think; refactoring is meant to leave functionality unchanged. He means something more like re-purposing. You would take a method and add an attribute to convert it to a web service. Of course ASP.NET already has this (WebMethod attribute), but Meijer’s idea seems to include greater intelligence about the plumbing behind the exposed method. He believes programmers should only need to think sequentially, even though in reality web applications may have multiple entry-points and users may do things like clicking the Back button.
Meijer applies the same thinking to concurrent programming; developers should be able to do this with simple attributes, rather than struggling with synchronization statements and the like. Similar logic applies to state handling: Meijer reckons programmers should be able to program statefully, and have the infrastructure deal with the problems.
We should give programmers the illusion that their servers are stateful, while we can implement that in some scaleable way. That should be done once instead of all programmers trying to solve that problem.
No roadmap
I chatted to Meijer after his session. He emphasised that there is no roadmap for implementing “LINQ 2.0”; he is merely sharing some research thinking. What I’ve described above may never be implemented, or may evolve into something very different. Some parts sound fanciful to me. Will the idea of compiling IL for different runtimes really fly? Is it feasible to reduce multi-tier programming to a few attributes? Will this be any better than DCOM, which was meant to make distributed objects easy, but proved more complex and less robust than had been hoped?
That said, there’s little doubt that advances in programming will be about introducing new levels of abstraction, which may well provoke scepticism among old-school developers. This has happened before. I respect Meijer for what strikes me as good work in LINQ 1.0, so I’m paying attention.
Technorati tags:
linq,
eric meijer,
qcon