What is new .Net Native [closed]
Asked Answered
B

1

28

Today I have read an article about the new .Net Native on MSDN.

"Windows Store apps start up to 60% faster with .NET Native and have a much smaller memory footprint. Our first release is a Developer Preview that allows you to develop and test apps with this new compiler. This preview release of .NET Native offers you the performance of C++ with the productivity of C#".

Of course, this is really interesting but If .Net Native is a new compiler which gives good performance then why we needs to go for RyuJIT. What is this new .Net Native? What is the difference between new .Net Native and RyuJIT, also Microsoft released compiler as a service called Roslyn. So how Roslyn supports this new .Net Native.

Borborygmus answered 4/4, 2014 at 16:19 Comment(5)
There is lot of work to be done before it becomes universally applicable. Particularly for desktop apps there are some very nasty problems still to be solved. Pretty unclear right now if they can solve them. I suspect that Store style app packaging needs to come first.Centennial
Oh man, now we are spposed to do your job and finding out informatin on external sites? Come on - this is not a "do my research for me, I fail in google fu" site.Sunroom
This question appears to be off-topic because it is about a recent product announcement and is not likely to attract informed answers.Kimberly
Roslyn compiles code to IL. RyuJIT is different, it compiles IL to machine code during runtime. It is an improvement over existing x64 JIT. .NET Native is a minimal CLR runtime. The compilation technique involves first compiling code to IL (for eg via Roslyn) which is then compiled to machine code (using VC++ compiler) before run. The benefits are faster startup, execution times etc but compilation takes longer. .NET Native apps aren't cross-platform. There's LLVM based LLILC which aims at compiling IL to machine code ahead of time just like .NET Native but also be cross-platform.Giant
Roughly put, Roslyn = C# to IL. RyuJIT = IL to MC, JIT. .NET Native = IL to MC, AOT. LLILC = IL to MC, AOT (in future), cross-platform. JIT means during runtime, AOT means before runtime. Project-wise, UWP Apps (in release mode) = Roslyn + .NET Native. Other = Roslyn + RyuJIT. This msdn blog gives a good picture.Giant
S
24

.NET Native is not part of the Roslyn project as such. Roslyn is a re-implementation of the C# and VB compilers and language services. Remember these compilers produce managed assemblies. In order to run, they have to be translated to platform specific code. This is typically done through the JIT compiler in the .NET runtime.

.NET Native allows you to turn .NET projects into native binaries similar to what NGEN does, but with a few important differences. .NET Native uses a different native compiler part than NGEN that produces faster and smaller code in general. It also allows a kind of static linking that is not available for regular .NET apps.

Shyster answered 4/4, 2014 at 16:26 Comment(8)
So Roslyn support is not available for the new .Net Native?Borborygmus
@VimalCK I believe you're thinking about this in the wrong way. Remember that the C# compiler doesn't produce native code. JIT/NGEN/.NET Native do that.Shyster
So it is possible to use Roslyn for C#->IL and then RyuJIT for IL->Native correct?Perl
Good question @AaronLS, I think so. But maybe not a easy way, and not the way microsoft is indicating. I think JIT is better designed to "dynamic native code generation" (as a runtime compiler).Leena
does it mean that we don't need to install .Net Framework on the client side?Lukas
@DayDayHappy, I would say 'no' but I'd like to hear from someone more experienced.Snuffbox
@BrianRasmussen So .NET Native is like writing C/C++ code on any platform (be it Linux or Windows)natively, but the only difference is the syntax (written in C# instead of C/C++)?Snatch
So .Net Native CLR's replacement for WinRT or windows store apps? But I also get into thinking when NGENed or store app assemblies already contain native code then you don't require Just-in-time compilation at all. So .Net native might just be providing the other remaining services provided by CLR e.g. CAS, exception handling, memory management etc. Does this sound like a fair understanding?Logography

© 2022 - 2024 — McMap. All rights reserved.