Microsoft reveals xlang: Cross-language, cross-compiler and coming to a platform near you

A lovely bit of open-source interop for the weekend

Got Tips? 27 Reg comments

Language interoperability efforts are underway at Microsoft in the form of the open-source xlang, which builds on the approach taken with WinRT.

The Windows Runtime (WinRT) is a noble attempt to replace the grungy C-based Win32 Application Programming Interface (API) with something delightfully object-orientated in C++. It made an appearance alongside Windows 8, and Microsoft envisaged a golden future for the platform-agnostic architecture. Agnostic, that is, so long as the platform was Microsoft's.

To be fair, the clue is in the name "Windows" Runtime.

Alas, the well-documented demise of Windows Phone and the inability of Universal Windows Platform (UWP) apps to set the world alight has left WinRT in a future quite different to the one its architects hoped for.

C++/WinRT gave developers a language projection for the WinRT APIs, providing first class access to the modern Windows API. Rather than having to deal with the Common Object Model (COM) world of WinRT, C++ developers can use standard C++ language features. Microsoft reckons it produces the fastest, most compact code for Windows.

Pop art style illustration of man exclaiming WHAT? in shock/horror/bemusement.

Microsoft has signed up to the Open Invention Network. We repeat. Microsoft has signed up to the OIN


Inventor of C++/WinRT Kenny Kerr (whom the team at Redmond wisely snapped up after taking a look at his efforts) has now kicked off work on a new project that builds on C++/WinRT but, in the ethos of the caring, sharing Microsoft, is very definitely cross-platform, cross-language, cross-compiler and did we mention it is open source as well?

It's this sort of thing that would have had Steve Ballmer flinging a sweaty shirt from the stage in alarm in the old days. Goodness knows what he would made have made of the whole patent thing.

As for xlang, Kerr suggested thinking of it as a bit like WinRT, but going further and supporting that hardly used platform, Windows 7, as well as the likes of Linux and Apple systems. The theory is that a developer could implement a function in one language (like C++) on one platform (say, Windows), and have it callable by another (maybe Python) on a different platform (Linux, anyone?). Nice, if it can be made to work.

The code is very pre-alpha at the moment, but can be downloaded and built in Visual Studio 2017 15.8.6 or later and Windows SDK 17663 or later. We fired it up using Preview 3 of 15.8.9 with no problems (a refreshing change from the game of "hunt the missing file/dependency" we've played on recent coding adventures).

The team is at pains to point out that this is most definitely not going to be a port of the WinRT, COM or any of Microsoft's crown jewels. It's more an interop technology at this stage and, to be fair, what is in the repo right now falls quite some way from the grand ideals espoused by the team.

But complaining about missing functionality, or that right now it only supports Windows with some limited C++ and Python support, is missing the point somewhat. It is more another signpost to Microsoft's thinking on where its development platform is going. And certainly worth an hour or so of prodding on a rainy Sunday afternoon. ®

Sponsored: Webcast: Simplify data protection on AWS


Biting the hand that feeds IT © 1998–2020