News for hackers. Stuff that matters.
Re:Microsoft to Explore Using Rust by steveklabnik on Thursday July 18, 2019 @01:38PM (#20472153)
> Its become almost impossible to see a new OS project succeed in the current landscape,

Fuchsia contains a considerable and ever-growing amount of Rust. And if you consider VM infra in the "OS" category, you have Firecracker from Amazon and crosvm from Google as well.

> maybe an entire AAA game written in Rust will be an interesting challenge.

We'll see how it goes; there is one studio that has made AAA-level games in the past using Rust now, and a new studio that is full of ex-EA folks.

> Personally, I want the program to crash rather than keep running

The alternative here isn't keeping running, it's "does not compile in the first place". That's even sooner than your crash, and guaranteed, as opposed to "happens to hit the right code path."

Re:Microsoft to Explore Using Rust by la_barba on Thursday July 18, 2019 @03:02PM (#20472939)
>The alternative here isn't keeping running, it's "does not compile in the first place". That's even sooner than your crash, and guaranteed, as opposed to "happens to hit the right code path."

Different people mean different things when they talk about correctness. I think it means accurately capturing the intent of the programmer, i.e. the logic/algorithm/code flow or whatever, and eliminating the ambiguity. How does rust help here?

Re:Microsoft to Explore Using Rust by steveklabnik on Thursday July 18, 2019 @03:14PM (#20473032)
Sure, if you’re talking about that, then Rust has more maintstream tools: a very strong and static type system, built in test framework, that kind of thing. You can help guard against logic bugs by using these tools more effectively, but they do require proficiency to use.
Re:Microsoft to Explore Using Rust by la_barba on Thursday July 18, 2019 @06:12PM (#20474431)
Right, but such tools are available across multiple programming languages, and the onus is on Test/QA to ensure that. Lets say that Rust eliminates memory crashing bugs by restricting certain freedoms afforded by C or C++. The problem of coordinating between multiple threads of who gets to do what when, and with which data and accurately capturing the intent of the programmer still exists. Now if you view the world through Rust-colored glasses, then any invalid state is the result of a programmer error because they used Rust incorrectly.

I'm saying that its this the same kind of programmer error (not being able to specify things without ambiguity or a way to capture intent accurately) that was the cause of the memory bug in C too. Its just that with C you will hard crash whereas in Rust you wont. You didn't crash but you modified a data structure you shouldn't have, and your program will still end up in an inconsistent state.

In much the same way, the kernel doesn't care what happens in userspace - which thread is doing what with memory or what userspace resources are being corrupted, etc. The kernel can trivially kill userspace threads at will, and continue to remain rock solid as ever. So yes while the separation of kernelmode and usermode helped the user escape from poorly coded apps, it didn't really help reduce the actual bugs as much.

Hopefully that made as much sense as it did in my head! :)

Re:Microsoft to Explore Using Rust by steveklabnik on Thursday July 18, 2019 @07:23PM (#20474949)
Sure, I don’t disagree with any of this, which is why I said “more mainstream.”
Re:Microsoft to Explore Using Rust by la_barba on Friday July 19, 2019 @11:48AM (#20479593)
OKay.. fair enough!