News for hackers. Stuff that matters.
Re:The .NET Native Tool-Chain by dochtman on Saturday May 10, 2014 @10:00AM (#7725404)
Yeah, the MDIL thing sounds like it could have been an LLVM IR derivative. Too bad they always have to NIH things (though I guess in this case there might be legitimate reasons to do something different than the level of LLVM IR).
Re:The .NET Native Tool-Chain by bunderbunder on Saturday May 10, 2014 @02:52PM (#7726495)
Too bad they always have to NIH things (though I guess in this case there might be legitimate reasons to do something different than the level of LLVM IR).

I'm going to guess that in this case, their reason to not go with LLVM was the most compelling one possible: When Microsoft was designing the .NET toolchain, LLVM didn't exist yet.

Given the timing of when it came out, I wouldn't even be surprised if LLVM wasn't at least partially envisioned as an open-source answer to .NET. In which case there's a hint of NIH behind LLVM, with Mono being the non-NIH open source option.

Re:The .NET Native Tool-Chain by xyziemba on Saturday May 10, 2014 @06:30PM (#7727046)
MDIL is designed to solve a different problem than LLVM IR. LLVM IR is an exchange format between a compiler frontend and backend. MDIL is designed to solve certain fragility problems in binaries.

.NET Native uses MDIL to create a looser coupling between NUTC and the runtime. This means NUTC doesn't have to understand the precise binary layout of the runtime. The binder takes care of fixing that up!

MDIL has more advanced capabilities too. For more background on MDIL, I highly recommend watching the video I linked to in the blog post: http://channel9.msdn.com/Shows/Going+Deep/Mani-Ramaswamy-and...

Re:The .NET Native Tool-Chain by pjmlp on Saturday May 10, 2014 @01:09PM (#7726093)
> Yeah, the MDIL thing sounds like it could have been an LLVM IR derivative.

It comes from the Singularity OS compiler toolchain, which is older than LLVM.

It is also used to deploy .NET applications as native code on Windows Phone 8 devices.

Re:The .NET Native Tool-Chain by gsnedders on Saturday May 10, 2014 @01:12PM (#7726099)
LLVM goes back to 2003, and Sing# is based on Spec# which is only 2004?
Re:The .NET Native Tool-Chain by pjmlp on Saturday May 10, 2014 @01:24PM (#7726142)
The Wikipedia mentions 2003 and we can assume there was already work going on before.

http://en.wikipedia.org/wiki/Singularity_%28operating_system...

Although the first published papers are indeed from 2004.

Re:The .NET Native Tool-Chain by gsnedders on Saturday May 10, 2014 @01:31PM (#7726175)
Work on LLVM started in 2000, FWIW.
Re:The .NET Native Tool-Chain by gsnedders on Saturday May 10, 2014 @01:06PM (#7726081)
Competition isn't per-se bad, and if we're assuming they aren't using LLVM, what gains are there to using the IR? More front-ends, I suppose. But I wouldn't be surprised if they had more machine dependent behaviour than LLVM IR (which, let's be honest, includes a fair bit), especially for things like overflow detection. There also are pretty bad limitations to LLVM IR's ability to deal with GC roots, which for MDIL will be especially important.
Re:The .NET Native Tool-Chain by stephengillie on Saturday May 10, 2014 @03:13PM (#7726554)
MS is one of the very few organizations to whom I'll give an NIH pass, if for no other reason than merely to have someone exploring alternate implementations.
Re:The .NET Native Tool-Chain by macca321 on Sunday May 11, 2014 @06:37AM (#7728328)
I don't know if there would be any point to Microsoft if they didn't NIH.
Re:The .NET Native Tool-Chain by zvrba on Saturday May 10, 2014 @01:03PM (#7726076)
LLVM IR is machine-independent, so the NIH accusation is not really fair.

MDIL is described to be the platform's native machine code + some extension tokens (to avoid direct encoding of pointers, for example).

A similar LLVM IR derivative would no longer be by a long shot something resembling LLVM IR, so the property of being "derivative" would not buy you anything.

Re:The .NET Native Tool-Chain by gsnedders on Saturday May 10, 2014 @01:09PM (#7726091)
LLVM IR is machine-independent? What? There's plenty that isn't machine-independent, from the obvious (e.g., x86_fp80), to the less obvious (to create IR in the first place one has to have knowledge of the target ABI), what integer types are supported (i64 isn't supported everywhere!), etc.
Re:The .NET Native Tool-Chain by barrkel on Saturday May 10, 2014 @02:50PM (#7726487)
LLVM IR is not machine independent, and is documented specifically as not designed to enable portable IR.
Re:The .NET Native Tool-Chain by Sephr on Saturday May 10, 2014 @03:24PM (#7726581)
PNaCl's LLVM IR is machine independent and can be used standalone without Chrome.
Re:The .NET Native Tool-Chain by gecko on Saturday May 10, 2014 @04:29PM (#7726769)
While true in a narrow sense, it does so by targeting the lowest common practical denominator—in practice, a chip that looks a lot like a 386 or 32-bit ARM with no SIMD pipeline. That puts it as little more than a better GNU Lightning.
Re:The .NET Native Tool-Chain by Sephr on Friday May 16, 2014 @08:29PM (#7758741)
Re:The .NET Native Tool-Chain by logicchains on Saturday May 10, 2014 @11:24AM (#7725705)
Hopefully it's not like the CIL (CLR intermediate language), which is competitive with Java in verbosity. E.g.

.class public Foo

{

    .method public static int32 Add(int32, int32) cil managed

    {

        .maxstack 2

        ldarg.0 // load the first argument;

        ldarg.1 // load the second argument;

        add     // add them;

        ret     // return the result;

    }
}

If you ever look at a disassembled CLR executable, expect to see a heap of lines like:

valuetype A* modopt([mscorlib]System.Runtime.CompilerServices.CallConvThiscall) 'A.{ctor}'(valuetype A* modopt([mscorlib]System.Runtime.CompilerServices.IsConst) modopt([mscorlib]System.Runtime.CompilerServices.IsConst))

Re:The .NET Native Tool-Chain by jbevain on Saturday May 10, 2014 @11:40AM (#7725767)
CIL - just like the LLVM IR - if human readable, is not really meant to be written by hand, unlike Java. Not sure what you mean here.
Re:The .NET Native Tool-Chain by logicchains on Sunday May 11, 2014 @12:27AM (#7727769)
LLVM IR is much less verbose than CIL, isn't class-based, and on the whole is much simpler. The CIL's complexity makes it less flexible than something like LLVM IR or JVM bytecode; this is one of the reasons alternative languages have flourish on the JVM, whereas the CLR only has C# and F#, and F# had to rely on the developers' influence at Microsoft to get the runtime to support some of its features.
Re:The .NET Native Tool-Chain by memsom on Monday May 12, 2014 @04:32AM (#7731675)
Err... there's more than C# and F# targeting the CLR. Even just from Microsoft (VB.Net and Managed C++), but there are a heap more.
Re:The .NET Native Tool-Chain by logicchains on Tuesday May 13, 2014 @02:59AM (#7736828)
I said flourished. Are there any non-MS languages on the CLR that have achieved equal popularity to that of Clojure, Scala or Groovy on the JVM?
Re:The .NET Native Tool-Chain by vorg on Tuesday May 13, 2014 @09:26AM (#7737987)
> achieved equal popularity to that of Clojure, Scala or Groovy on the JVM

Clojure and Scala seem to be tied for 2nd place popularity behind Java, but Groovy's lagging far behind. Were you looking at the bintray-maven download stats at https://bintray.com/groovy/maven/groovy/view/statistics for Groovy when you put it in with Scala and Clojure? Even tho those stats show 660,000 downloads of Groovy over the past month, click on country and you'll see 625,000 of them came from a server in China, only 12,000 from the US, and 2000 from Germany, the 3 biggest countries. Obviously the China stats are fabricated. Groovy's true popularity is far behind Scala and Clojure.

Re:The .NET Native Tool-Chain by logicchains on Tuesday May 13, 2014 @10:17AM (#7738234)
I was just listing what I assumed were the top 3 most popular non-Java languages on the JVM. But perhaps it's already been overtaken by Kotlin or Ceylon.