Microsoft launches preview of .NET Native (Project N) for making faster Windows 8 apps

About five months after Microsoft showed off what it called "Project N" at the Visual Studio 2013 launch, the company has now released a developer preview of the compiler designed to make Windows 8 apps have faster performance; the code now has the official name of .NET Native.

In a blog post this week, Microsoft said this first preview version is designed to make apps that will work with Windows RT and the 64-bit version of Windows 8.1, with support for the 32-bit version coming in the near future.

Microsoft said:

The .NET Native compiler uses the world-class Microsoft VC++ optimizer back-end to make your app run faster. .NET Native libraries are refactored and optimized for Store apps. And .NET Native has the capability to link in library code your app uses into the app, allowing the optimizer to work globally across your app’s code and library code.

The end result is that apps made with .NET Native are supposed to launch up to 60 percent faster once they are started by the user, while at the same time use 10 to 20 percent less memory. Microsoft has already made a number of Windows 8 apps with .NET Native, including the game Wordament and the Fresh Paint digital drawing tool. There's no word when Microsoft will launch the final version of the compiler.

Source: Microsoft via ZDNet | Image via Microsoft

Report a problem with article
Previous Story

Development continues on Windows Phone 8.1; final build expected April 14th

Next Story

Motorola officially unveils Moto G Forte

15 Comments

Commenting is disabled on this article.

It's funny because when people used to complain about .NET not being compiled we used to get bashed that it was better and faster than native code.....And now this?

OK, I'll try to answer this one. Bear with me, the post will be a bit long.

You may be mixing up the reasons behind that "bashing" with what this is.

I'm not sure who seriously claimed that .NET was supposed to be faster than native code. Perhaps someone who was talking about optimizations done by the compiler and theoretically faster code in niche cases? But in that case, the native code was probably not all that great to begin with. A .NET developer can usually AT BEST expect the code to perform on par with native code (usually, it doesn't and is about 2x-3x slower). The slightly slower .NET code is often not a problem in practice though, since a modern interactive app spends by far the most time waiting for user input.

But of course the general overhead to run .NET code is greater than, say, C code. C/C++ was designed to be an abstract layer on top of assembly language. .NET is not really competing in that league, and is more about RAD development. It wasn't invented to "kill C++". Look at Java and you may be closer to a competitor.

However, as for being "better", .NET can certainly be that since .NET applications often need less code than native languages, so there is most likely a lower cost (both in time and money) to maintain a .NET application than a native application. The higher level langauge that e.g. C# is will also reduce the risk of bugs, especially buffer overflow problems or bad pointers.

So to answer your "And now this?" question, the "best" language depends on what you are doing, but .NET Native would absolutely be a major improvement over .NET in many cases, which in turn CAN BE an advantage over C++ depending on what you're doing. Integrated systems, robotics? Hmm, maybe not. An interactive desktop app? Yes, .NET is much more likely to be a better choice.

So this is not Microsoft "backtracking". This is Microsoft further reducing the need to go to a lower level language, Microsoft helping people spend less time with code maintenance, and more time with the bigger picture.

It's a logical and important step forward for .NET and is a great idea, just like how .NET is a great idea, and how C++ is a great idea.

Edited by Northgrove, Apr 4 2014, 10:01am :

So I'm a little confused. Does .NET Native use Xamarins methods to compile native executables from C#? So C# -> C++ -> Machine Code? If true, does this mean we'll start to see drivers and firmware written in C#? If so, awesome! But if it's just a faster framework, as a developer I would say they're better off making me a good networking library for C++ to be honest. And on a further note, my problem with the gorgeous supermodel of a language that C# is has nothing to do with performance and everything to do with portability. I like programming straight to the hardware (no middleware and as little OS dependency as possible). When I can program atmel hardware with C# I'm sold! but until then it's C and C++ for me almost exclusively.

Kirkland Yuknis said,
So I'm a little confused. Does .NET Native use Xamarins methods to compile native executables from C#? So C# -> C++ -> Machine Code? If true, does this mean we'll start to see drivers and firmware written in C#? If so, awesome! But if it's just a faster framework, as a developer I would say they're better off making me a good networking library for C++ to be honest. And on a further note, my problem with the gorgeous supermodel of a language that C# is has nothing to do with performance and everything to do with portability. I like programming straight to the hardware (no middleware and as little OS dependency as possible). When I can program atmel hardware with C# I'm sold! but until then it's C and C++ for me almost exclusively.

In my experience the performance of application functions aren't any faster when compiling a .NET program natively. It does not turn it into C++. The only thing you save is the code does get JIT'd, which is why it saves on application start time and memory footprint.

The rest of the code won't be any faster.

If Microsoft want success, build tools to create cross platform apps.
Windows, Android, it's and other by only write once

I know all about Xamarin but does this whole Project-N-compiling-down-to-C++ lend itself in anyway towards making cross platform development easier? In particular one .net code base to rule them all?...(and no I'm not interested in using WinJS).

Oo nice, better performance plus no longer requires to have the dotNET platform installed on the target system... makes for much easier deployment.

This is definitely needed. Most of these Windows 8 apps have an oddly slow launch time. I hope, especially with future updates, full screen 8 and windowed modern apps become more prevalent. Cleaner install and removal process.

Developers seem to be touchy on the 8 store concept though.

Lots of good news today for developers, and this is just one of them. The argument has always been about performance when it comes to .NET and managed code and so on. This helps with that now and if the numbers are correct there should be little difference performance wise between a C++ store app and a C# one I'd think.