Besides, syntax and complexity wise I think Rust is even worse than C++.
As a gamedev I am not interested in Rust. Zig, Jai and Odin seems much cooler/interesting.
Besides, syntax and complexity wise I think Rust is even worse than C++.
As a gamedev I am not interested in Rust. Zig, Jai and Odin seems much cooler/interesting.
I really hope this sort of strawmanning doesn’t become common here. In response to any reasonable discussion about Rust the response seems to be “you’re fine, but the other enthusiasts are so unreasonable”. Where are these enthusiasts? Why bring them up when you can just respond to the person you’re talking to?
It’s super annoying because even on irrelevant threads such haters will call people’s attention to these imagined enthusiasts. Like this comment from 6 days ago calling people jihadis if they like a language - https://news.ycombinator.com/item?id=32640154. Note that the jihadis didn’t exist on the thread, only in the commenter’s mind.
> I will say that I've never written a line of Rust in my life and certainly can't be described as representing the Rust community in any way.
If this is the best example out there then it does feel like GP was arguing against a strawman.
But even otherwise, please let’s acknowledge that in any large community there’s going to be a minority who are loud and rude. It doesn’t advance the conversation much to point it out. They don’t represent the whole community any more than the comment I linked to represents the whole HN community.
All I can say is that whenever I’ve seen such rudeness it’s moderated out pretty quick, whether here or elsewhere.
I don't think anyone here is saying that, at least in this thread the parent(and myself) were both careful to qualify there might be contexts that it could be useful in. If you see anyone saying that Rust solves every single problem then feel free to call them out for being full of shit :).
I'm not going to be giving my designers a Rust tutorial the same way we did with scripting Lua, you're still going to have a FFI somewhere which will require unsafe and a bit more care. However having had maintained pretty significant codebases in quite a few languages I will say that Rust code is more stable, crashes less and still runs in the same footprints as C++(C gets the codesize edge by having a much smaller stdlib and surface area). It's about knowing where your tools do well and where they have rough edges and a better tool is appropriate.
Having to switch between C, C++ and Rust codebases on a regular basis I think you're underselling the complexity of C++ and overselling how difficult Rust is. C++ has a huge surface area, you have to figure out what subset you want to use(exceptions: y/n?, RTTI: ditto, stdlib or custom containers, etc). Then you get into Rule-of-5, move semantics, template metaprogramming, undefined behaviors(don't use global constructors/destructors). I could easily list 20 years of various ways I've seen C++ explode in spectacular ways(volatile semantics anyone?).
If you want to use C, Zig, or C++ more power to ya. No one is forcing you to use Rust but for those of us who are interested in a language that isn't dragged along with decades of baggage Rust offers a compelling development story and largely delivers on the areas it aims to hit(accessible systems development, memory safety and first-class tooling in my experience).
Next question.
There is no substitute for engineering, if you care. So, engineer.
Avoid triggering exceptions too hard to recover from. That might involve work, but less work than fielding error codes would have been. There is no free lunch.
The compiler’s error messages are fantastically helpful these days. Might be worth a tinker some rainy day, but understand being completely turned off of something as well.
https://play.rust-lang.org/?version=stable&mode=debug&editio...
If that code ever gets more use than that you expect, you can trivially find all the uses of “unwrap()”, and add the proper error handling. And yes there are quite a few places where things can go wrong.
But this explicit “signing for technical debt” when it relates to error handling is a really convenient productivity feature in practice.
A simple throwaway CLI for your own use is absolutely fine to use unwrap(), and you can fix it later on if it becomes a problem.
Some stuff that places Rust going into the same kind of complexity as C++.
Figuring out how to turn DAG algorithms into tree based ones, two macro systems, async infrastructure, Pin and PhantomData special fields, GAT (when they arrive).
Lets see how it looks like with 40 years of production code, on the other hand C++ is indeed reaching PL/I levels of complexity for those that care about ISO legalese.
I can't go along with this at all