News for hackers. Stuff that matters.
Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by jungler on Wednesday November 21, 2018 @09:34PM (#18507546)
Rust is good at solving certain scaling issues in large applications: Servo, the lead usecase for Rust, can safely take many parallelizing optimizations that would be unfeasible to debug anywhere else.

That does not make it a defacto winner for any other problem space. For games, for example, having to reason about concurrency is the status quo for most of the gameplay code regardless of the memory management system, and tightening memory only addresses a fragment of the problem space, because dynamic memory allocation is not a primary requirement(fixed sets of assets and fixed design constraints mean that a heavily static, early-binding approach to game coding works for most things, most of the time - so the difficult errors will tend to surface outside of memory management as an odd runtime behavior). [0]

As a drop-in "better C" it's not a great fit, either, because the focus is on making these in-the-large problems a top concern at all times. It creates friction in migrating to Rust, leaving the floor open for a smaller language that operates at the lowest levels of safety, doing its best to be both C-compatible and improve the parts that can't be addressed by leveraging or patching up the existing C ecosystem.

Zig is my top pick for a language that can address this niche, though it's still an early stage project.

[0] AAA-scale code can still benefit, of course. Most games aren't AAA.

Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by eridius on Thursday November 22, 2018 @01:55AM (#18508353)
Rust’s solution to concurrency is a hell of a lot more than just solving memory management. As long as you avoid `unsafe`, Rust statically prevents all race conditions. Rust also makes it so if you can parallelize something, then you’ve proven that it’s safe to parallelize it, and therefore you can parallelize complex systems in Rust that you simply wouldn’t have the confidence to do with other languages.
Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by steveklabnik on Thursday November 22, 2018 @04:13AM (#18508844)
Rust prevents data races, not race conditions.
Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by eridius on Friday November 23, 2018 @01:40AM (#18514790)
You're absolutely right, I meant to write "data races" there.
Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by stochastic_monk on Thursday November 22, 2018 @12:08AM (#18507987)
In my lab, we’ve been discussing it seriously for a while. We think it’s probably best-suited for a highly multithreaded environment which can’t be trivially parallelized. Until we need that in particular, C++ will most likely meet our needs quite well.
Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by eggy on Thursday November 22, 2018 @03:37PM (#18512388)
Another vote for Zig. I am intrigued with Rust, but don't get too far with it as with other languages, but understanding its mission statement is a lot more comprehensive. The Rust Programming Language book is very well written, however, by the end of the book it feels like you are just learning the language with no stimulating examples. I am using Zig, and making great progress with my personal projects, and look forward to being much more productive in the near future.
Re:Ask HN: Will Rust replace C/C++? What's holding it back? ... by ArthurBrussee on Thursday November 22, 2018 @01:27PM (#18511594)
Jai is trying to fit that C space too. Similair ideas to Zig, but more aimed at the games industry. Curious to see which ends up gaining more traction (if either do, fingers crossed)