News for hackers. Stuff that matters.
[dead]
Re:Announcing Rust 1.11 by vardump on Thursday August 18, 2016 @04:04PM (#12315924)
Why a major OS would need to be "picking up Rust as a first class citizen"? What does that even mean?

So far no major OS has picked C++, Java or any other language than C as a first class citizen either. All of the OS related loadable library APIs are still C.

Doesn't seem to slow down any of those languages, though.

Re:Announcing Rust 1.11 by kbenson on Thursday August 18, 2016 @04:37PM (#12316143)
> So far no major OS has picked C++

For the sake of clarity, Windows is supposed to be written in C and C++ (the kernel in C, the rest in C++).

Re:Announcing Rust 1.11 by favorited on Thursday August 18, 2016 @09:17PM (#12317408)
Also, the open-source XNU kernel (OS X & Darwin) has both C and C++ components.
Re:Announcing Rust 1.11 by pcwalton on Thursday August 18, 2016 @04:29PM (#12316100)
1. Rust isn't a component of Firefox.

2. I'd be interested to know why Servo is a "pipe dream".

3. Why does a major OS need to pick up Rust as a "first class citizen", when they haven't done so for JavaScript, Java, Python, PHP, Ruby, Go, D, Scala, Haskell, Lua, Clojure, etc. etc.?

Re:Announcing Rust 1.11 by the_mitsuhiko on Thursday August 18, 2016 @03:53PM (#12315820)
Firefox and Mozilla might very well go down but Rust can stand on its own. Not sure however what "first class citizen" for a programming language on an OS means. Can you clarify?
Re:Announcing Rust 1.11 by akerro on Thursday August 18, 2016 @04:07PM (#12315963)
He wants to rewrite Linux in Rust, probably.
Re:Announcing Rust 1.11 by cageface on Friday August 19, 2016 @02:08AM (#12318238)
Why is Firefox "on hospice"?
Re:Announcing Rust 1.11 by executesorder66 on Friday August 19, 2016 @05:27AM (#12318854)
It's not a major OS but check out: https://www.redox-os.org/

Those guys are insanely good. And you can help them make redox a major OS by contributing.

Re:Announcing Rust 1.11 by steveklabnik on Thursday August 18, 2016 @03:35PM (#12315679)
I don't share your evaluations here, but a question:

  > no major OS seems to be picking up Rust as a first class citizen, 
What would this mean to you?
Re:Announcing Rust 1.11 by antod on Thursday August 18, 2016 @05:51PM (#12316563)
Yeah not really sure what that was supposed to mean in relation to Rust. To me that statement would only make sense for languages that require some sort of runtime/interpreter installed rather than natively compiled.

eg Python and Perl get shipped by default in most Linux distros base image, whereas Java or Ruby don't tend to be.

Whereas C doesn't have a compiler shipped in some/most base images - despite C being about as first class as languages get on Unix.

Re:Announcing Rust 1.11 by steveklabnik on Thursday August 18, 2016 @06:02PM (#12316653)
Yeah. I was also wondering if they meant "available through my distro's package manager", in which case, that's been happening a lot lately. Debian and Fedora will both have initial packages in their next releases, and work is ongoing with a number of linuxes.
Re:Announcing Rust 1.11 by rkangel on Friday August 19, 2016 @04:58AM (#12318757)
I was composing a much longer answer before I realised that this is actually a really interesting question. While I try and think through that, this is my immediate reaction. It comes down to one thing: the ABI.

Only C (and therefore to some extent C++) is the first class citizen in all the major OS families we care about, because the C ABI is the standard for compiled objects (whether executable or library).

Re:Announcing Rust 1.11 by steveklabnik on Friday August 19, 2016 @10:27AM (#12320217)
Totally. Rust is still far too young for something like ABI stability, so it wouldn't even make sense as an option yet. But beyond that, this pretty much puts the world in two boxes: "C" and "not C". There's a lot of activity in the "not C" space, so being there isn't an automatic death-knell for Rust, as the OP seems to imply.
Re:Announcing Rust 1.11 by rkangel on Friday August 19, 2016 @10:52AM (#12320407)
> Rust is still far too young for something like ABI stability

Without question.

The interesting question to me is (if starting again) whether ABI stability/compatibility is something that is necessary or desirable for userspace citizens to interoperate with each other and the kernel.

Re:Announcing Rust 1.11 by pcwalton on Friday August 19, 2016 @11:59AM (#12320966)
> Only C (and therefore to some extent C++) is the first class citizen in all the major OS families we care about, because the C ABI is the standard for compiled objects (whether executable or library).

Well, on Windows there's COM for this, which is technically the C ABI too, but really deserves to be considered its own thing.

Re:Announcing Rust 1.11 by the_why_of_y on Friday August 19, 2016 @07:40AM (#12319346)
Yes, that's it. To keep things maintainable, OS interfaces are available to applications in the form of shared libraries, and that requires a well-defined and stable language ABI.

It's regrettable that C++ currently has an advantage over Rust in this regard...

Re:Announcing Rust 1.11 by UtherII on Friday August 19, 2016 @10:31AM (#12320245)
C++ has no advantage over Rust in this regard : C++ and Rust does not have stable ABI. But both can use the C ABI when a stable ABI is needed.
Re:Announcing Rust 1.11 by the_why_of_y on Friday August 19, 2016 @02:33PM (#12322306)
C++ is not just boost and ICU - there are a handful of C++ libraries with a good ABI compatibility track record, for example Qt and the KDE stack.

The C++ ABI of Microsoft Visual Studio is stable since practically forever, albeit with a severe restriction: the language ABI is stable, but not the C++ (or even C) standard library ABI - every Visual Studio release comes with a new incompatible msvcrNNN.dll. But you can load as many different runtime libraries into a process as you like, the big practical restriction is that you can't pass standard library objects allocated by one runtime to a different one.

The C++ ABI of GCC is stable since version 3.2, released in 2002, on x86 platforms (there were numerous fixes in later releases for other platforms). They even managed to retrofit new incompatible C++11 requirements on std::string with some preprocessor hackery and namespace mangling, without bumping the libstdc++ SONAME.

As usual, on macOS the situation isn't as good because they threw out libstdc++ for some clang reinvention of the wheel.

Re:Announcing Rust 1.11 by quicknir on Friday August 19, 2016 @04:07PM (#12323085)
It's not really true that C++ does not have an ABI advantage over Rust if (by your own comment) they both end up using the C abi. Although pedants will insist that C is not a subset of C++, practically speaking you can write idiomatic C perfectly fine that will compile with a C++ compiler, and much C code in the wild is actually written this way. And most moderately experienced C++ developers are very comfortable with all of these elements and syntax (like pointers, goto, C style callbacks, etc), because they are a subset of their own language. It's very straightforward to have your API be C (and therefore have a stable ABI) but do implementation in C++. Even some C standard libraries do this.

In summary, if you're writing a C API/ABI, source compatibility is still a major advantage, there is no two ways around it.

Re:Announcing Rust 1.11 by steveklabnik on Friday August 19, 2016 @10:25AM (#12320206)
Only barely though, C++ is still notoriously hard to link to.