These kinds of posts would be much more interesting if they discussed alternatives considered and rejected. For example why did they choose Rust over C++?
Maybe they just want to try to see which way the wind is blowing before making a decision which would require more than a little effort to achieve?
I’m actually surprised that the general consensus isn’t rust as that’s the new shiny plus the people saying C++ are giving very valid reasons beyond the usual language dogma arguments that these discussions usually devolve into.
I think it's because Rust was started by a high-profile, respected company specifically because they felt C++ was inadequate for their use case, and they had the expertise to be authoritative about that inadequacy.
That means Rust is a technologically natural counterpoint to C++ because it was literally designed to be a C++ replacement, and coming from a high-profile company means its entire target audience found out about it very quickly, so any discussion relevant to Rust can find plenty of participants. The rest is just due to all the usual reasons programmers bicker about things, and we've seen this language bickering again and again before, it's just a different language's turn in the spotlight.
I'd love to see these discussions include a more coherent analysis of when a language is appropriate, instead of assuming everyone should always make the same choice. If I'm starting greenfield, when should I pick C++ over Rust? If I'm looking at C++ alternatives, how would I choose between Rust and Golang? Is D ever a better choice? When? Why do we act like you can only pick one, when IPC and FFI and microservices mean you can split the difference if a language is only best for a portion of your project?
Author of blog post here: Interesting that you say that. I came really close to saying in the blog post that Rust could be the alternative to C++ that I am looking for. But then I decided that I know way too little about Rust at this point to make that statement.
Rust is great, but its adoption is minuscule compared to C++. Given the point of this release is to encourage wide scale adoption of certain algorithms, C++ is the realistic choice at this time.
I am happy to be honest that I have not spent much time of rust, other than browsing sample code and reading about user experience, the borrow checker, etc.
For me, I could not see myself using rust especially for game development. Some of the points raised are my concerns, especially wanting to chuck something together (to improve later) only to fight the compiler, etc.
I would be interested to know what language they choose moving forward. It seems the contenders are likely to be:-
C - because, you can,
C++ - ditto,
D - I think it is largely ignored, and there is the betterC flag
Zig - Seems interesting,
Odin - Also interesting
Anyway... going to enjoy reading the comments, now.
just because I don't have to deal with 15 compilers, 15 IDEs, 15 build systems, decades of language experiments, kind of compiler-flags driven development
I think at this point, Rust will not really replace C++ just like how C++ never replaced C.
Given the learning curve of Rust and the lack of tools it's still a bit of a gamble to choose Rust over C or C++ IMHO. Why take that risk when the benefits aren't entirely clear cut.
They want to promote their own language and wanted at least two reasons against Rust (the first with lack of LLVM support for many smaller embedded platforms is true).
To me Rust is much easier to understand than C++. But C is still more straightforward.
Because Hacker news has a large population of systems programmers, and we are desperate for something to liberate us from C and C++. We have watched programming languages advance apace in other areas, helping engineers be more productive and produce a higher quality output, but in the systems space nothing has come along that provides enough benefit for a low enough adoption cost for it to be a worthwhile choice over C and C++.
Rust shows some promise of being that language, and so we hold out hope and enjoy reading about it.
Not all organizations are in a position to make the switch or even want to. I personally like Rust and find it interesting, but that doesn't mean I would throw away my C++ codebase.
I'm sure other people will be able to share reasons their organizations use C++
Rust is a better C++ more than a better C, it has similar goals to C++ of advanced zero-cost (at runtime) abstractions, not so much of being a portable assembly. Like C++ it can be an alternative to C in some contexts.
D intended to be a better C++, but that hasn't panned out well in practice for various reasons (one of them being the use of a GC and much of the standard library depending on it, though IIRC they're trying to fix that).
reply