Oh no, you're thinking, yet another cookie pop-up. Well, sorry, it's the law. We measure how many people read us, and ensure you see relevant ads, by storing cookies on your device. If you're cool with that, hit “Accept all Cookies”. For more info and to customize your settings, hit “Customize Settings”.

Review and manage your consent

Here's an overview of our use of cookies, similar technologies and how to manage them. You can also change your choices at any time, by hitting the “Your Consent Options” link on the site's footer.

Manage Cookie Preferences
  • These cookies are strictly necessary so that you can navigate the site as normal and use all features. Without these cookies we cannot provide you with the service that you expect.

  • These cookies are used to make advertising messages more relevant to you. They perform functions like preventing the same ad from continuously reappearing, ensuring that ads are properly displayed for advertisers, and in some cases selecting advertisements that are based on your interests.

  • These cookies collect information in aggregate form to help us understand how our websites are being used. They allow us to count visits and traffic sources so that we can measure and improve the performance of our sites. If people say no to these cookies, we do not know how many people have visited and we cannot monitor performance.

See also our Cookie policy and Privacy policy.

This article is more than 1 year old

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

A lovely bit of open-source interop for the weekend

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

READ MORE

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. ®

Similar topics

TIP US OFF

Send us news


Other stories you might like