News for hackers. Stuff that matters.
Re:C as an Intermediate Language (2012) by pcwalton on Monday May 16, 2016 @12:16AM (#11704212)
It's not doable. How do you deal with UB from signed overflow? How do you get proper debug info? How do you set the proper EH personality?

There are no shortcuts to a proper implementation of Rust. Implement an LLVM backend for your architecture. It doesn't make sense for Rust to maintain a backend that is doomed to be forever broken in various ways.

Re:C as an Intermediate Language (2012) by jjnoakes on Monday May 16, 2016 @07:55AM (#11705704)
I answered your ub question elsewhere. Exceptions and debug info come from C++. I don't see the issues there yet, but perhaps I just don't have the right knowledge yet.

Rust won't have to maintain the backend. Who said they would? They might choose to if it becomes useful - it would give them things they dint have now (C++ interoperability, and new platform support for almost free), but no one here asked them to maintain anything.

I am also not sure what you mean by shortcuts or broken forever in various ways.

Re:C as an Intermediate Language (2012) by pcwalton on Monday May 16, 2016 @11:54AM (#11707122)
> Rust won't have to maintain the backend. Who said they would? They might choose to if it becomes useful - it would give them things they dint have now (C++ interoperability, and new platform support for almost free), but no one here asked them to maintain anything.

If out of tree, the backend will constantly break due to massive compiler churn. You need it in tree.

Re:C as an Intermediate Language (2012) by jjnoakes on Monday May 16, 2016 @12:20PM (#11707342)
I don't think so. The backend would simply lag behind major releases a bit. It's not going to use all of the compiler internals, so updating it will only be a little extra work if the HIR (or maybe MIR, depending) changes.

If Rust has plans on building a large amount of their internal optimizations on MIR, then I would think MIR would be fairly stable too, which makes this even less of an issue. It's going to be a toy project for now. If it works out, it'll be maintained against a specific version of the Rust compiler (stability is important in industry). And if that works out even more, perhaps Rust will accept patches to put it in-tree.

Of course, in-tree would be better. But it isn't a requirement.

But none of that is important at this point.