TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Announcing .NET Native Preview

159 pointsby xyziembaabout 11 years ago

16 comments

keithwarrenabout 11 years ago
It seems the comments area here is full of lots of questions and few answers. Let me try to clear some things up.<p><i>Lets start with how it currently works...</i><p>When you create an application or website in C#,F#,VB.NET or any other .NET language you are not really &#x27;compiling&#x27; it per se to native code, you are compiling it to an intermediate language called IL - very much like Java byte code. When your application or website is run for the first time the .NET runtime converts this code to native code on the local computer and then caches this binary and officially compiled native version of your code. The result is, the first time you run your app or a section of the code there is a small performance hit while the .NET runtime converts your code to native. Let me be perfectly clear, this is a one time thing - a first time thing. Once you have gotten past that every subsequent run is going to be as fast as other native code. (Why is it not as fast as something written in c or c++ you may ask - because there are other things the .net runtime is providing for you like garbage collection, but that is a whole other talk)<p><i>So how is this different?</i><p>This preview allows you to skip this JIT process and image caching process altogether. This is first targeted for Windows store apps, when you would first run it on your machine it was slow on first launch because all this extra work was being done. Microsoft decided they could take the server side resources they had and run this JIT and imaging process ahead of time and when someone downloads and installs your app - this work was already done and first launch would be faster - as much as 60% faster. There are also lots of changes under the hood to make this all work better - Andrew Pardoe is on this comment thread further down and mentioned things like a refactored runtime, static-optimized libraries, static marshalling all combining for performance wins.<p><i>Does this mean I can build apps for Unix with C#</i><p>No, Mono is still the best way to do that<p><i>Can I build simple console apps with this and deploy to machines without the .NET runtime?</i><p>No, right now this is only available for Windows Store apps. Besides, unless you have some Windows 98 machines sitting around nearly every PC has the .NET runtime.<p><i>Will this make my app run faster?</i><p>Starting up, yes. Normal operation, probably not. .NET runtime and jitter have been around a long time and they are impressively efficient and fast. This includes some tweaks to parts of the runtime but don&#x27;t expect to see your text file processing app go from 10 seconds to 2 or something like that.<p><i>Will this help me pick up chicks?</i><p>Depends.
评论 #7520842 未加载
评论 #7520800 未加载
评论 #7522047 未加载
评论 #7522360 未加载
评论 #7520664 未加载
评论 #7521849 未加载
modelessabout 11 years ago
So, uh, can I compile my C# app to an bare x64 .exe file, statically linked with no runtime dependency on the .NET Framework, that will run on Windows 7 and 8? Or not?<p>Edit: This is a much better link: <a href="http://msdn.microsoft.com/en-US/vstudio/dn642499.aspx" rel="nofollow">http:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-US&#x2F;vstudio&#x2F;dn642499.aspx</a> Still not sure though, as they say &quot;only Windows Store apps can be created&quot; which sounds suspiciously like &quot;no&quot;.
评论 #7520585 未加载
评论 #7520555 未加载
评论 #7521412 未加载
tdicolaabout 11 years ago
I&#x27;m kind of scratching my head here, can someone explain what problem this solves? There&#x27;s already a CLR and already a way to build native apps for Win 8, etc. This is a new CLR that can run new &#x27;native&#x27; apps?
评论 #7520075 未加载
评论 #7520055 未加载
DevKoalaabout 11 years ago
What is the difference between this and NGEN? Anybody?
评论 #7520127 未加载
评论 #7520132 未加载
tsenkovabout 11 years ago
Was someone from marketing writing this: &quot;the performance of C++ with the productivity of C#&quot; ... on startup. And not even on every startup, but only the first. And not even the first, since, as you know, there already are a lot of (unarguably, productive) features (such as GC etc.) making apps slower than C++ apps.<p>Also, is it just me, but this sounds like a glorified NGen in the usual build process (compiling for production goes straight to native), instead of NGen in the background optimisation service?<p>I am all about getting the new tools, switching to new, more productive ways of development (in fact I was programming in C# for about 3 years), I simply hate when false information is being spread, just because it sounds better to the sales person.
overgardabout 11 years ago
Do native apps still require a preinstalled CLR?
评论 #7520082 未加载
VexXtremeabout 11 years ago
So is this going to work on Linux?
ksecabout 11 years ago
There was GCJ that used to do this for Java. Sadly it has been discontinued.<p>It is interesting how every old is new again, we went from AOT to JIT and Back to AOT again.
评论 #7522866 未加载
rbanffyabout 11 years ago
It&#x27;s interesting. It&#x27;s more like a &quot;static JIT&quot; (BIT?) that does not account for the different data characteristics the instructions will process (which is something a JIT would&#x2F;should do because it alters the actual program flow), but I find the &quot;fast from the start&quot; idea very compelling. I wonder how long will it take to Oracle (or the OpenJDK folks) to react to it.
mamcxabout 11 years ago
This could lead to a way to build a dynamic language on top of .NET and eventually be usable in iOS? I ask because: <a href="http://docs.xamarin.com/guides/ios/advanced_topics/limitations/" rel="nofollow">http:&#x2F;&#x2F;docs.xamarin.com&#x2F;guides&#x2F;ios&#x2F;advanced_topics&#x2F;limitatio...</a> aka: No Dynamic Code Generation
apiabout 11 years ago
Only for Windows store? So who thinks walled gardens and feudalization are coming to all desktop OSes in the next 5 years?<p>In the future, a store &#x2F; certificate authority will be able to arbitrarily revoke your right to run anything on your computer that isn&#x27;t approved.
评论 #7521896 未加载
评论 #7521173 未加载
评论 #7520693 未加载
bananasabout 11 years ago
This is great. I hope they make this available for web apps because we&#x27;ve got 45 second warmup time and CPU spamming due to the massive size of the work the JIT has to do when we deploy. Total pain.<p>I imagine this would help them keep costs down on Azure as well.
评论 #7521924 未加载
评论 #7521904 未加载
forgotAgainabout 11 years ago
Its truly a great thing. A single file deployment would be a tremendous improvement. Also removing the ease with which distributed applications can be decompiled helps as well.<p>Hopefully the marketing people let them spread it to all of their application types.
Yuioupabout 11 years ago
No mention anywhere of ASP.NET. Is this going to help ASP.NET in any way?
评论 #7522239 未加载
BuckRogersabout 11 years ago
So is this the mysterious &#x27;M#&#x27; technology revealed?
评论 #7521550 未加载
detayabout 11 years ago
Microsoft: &quot;We could speed up your server-side code, but instead we did speed up the slow windows mobile apps that nobody cares about.&quot;
评论 #7521845 未加载