Re:Microsoft asking for engineer to work on a native compile...
by RyanZAG on Wednesday November 28, 2012 @08:40AM
(#4842436)
Good point, but unsafe code works just fine without compiling to native in the first place. JIT CIL unsafe code would probably perform identically to compiled code, as you'd only use unsafe code inside tight loops anyway - and the JIT will have compiled it to native on/before the first pass through.
[ Parent
| on HN ]
Re:Microsoft asking for engineer to work on a native compile...
by pjmlp on Wednesday November 28, 2012 @08:54AM
(#4842499)
I got a bit confused by your statement.
CIL is always compiled to native code, either via JIT or AOT (ngen, mono -aot).
Re:Microsoft asking for engineer to work on a native compile...
by RyanZAG on Wednesday November 28, 2012 @09:09AM
(#4842567)
That's right - I was addressing the issue where people think that they will turn C# into C++ by allowing for 'native compile'. In the cases where you use normal C#, compiling to native isn't going to make your code run as fast as C++ as you still have bounds checking, garbage collection, etc. In the case where you use unsafe C# code inside a loop, it's going to be running as native code anyway once the JIT runs through it.
ie. This story is terribly misguided as it seems to imply that C# is changing into something else because of a few compiler changes...