Ask HN: Is Rust worth investing in as a reliable C-alt given its recent saga?
I've been programming in high-level languages for a while and recently I was thinking about learning something more bare metal. Rust stood out as one of the popular C/C++ alternatives. But for me, the investment in a language is driven by not just the beauty of the language itself, but the community around it.
As an outsider who's keeping an eye on Rust, am I better off sticking to vanilla C/C++?
46 comments
[ 2.9 ms ] story [ 93.0 ms ] threadThorough feature discussion, appropriate licensing, and accessibility of source code for risk evaluation are metacharacteristics that are relevant.
And-lest anyone think that, as a white cisgender male born in America, I have no skin in the game, it is my belief that any interactions with others ought to be principled on transparent rigor and mutual respect, from which all other things should flow.
And this: https://news.ycombinator.com/item?id=36105637
And this: https://news.ycombinator.com/item?id=36106942
I agree with that, but that stuff you mention is still a factor. Politics is creeping into everything, and there are lots of reasons why choosing a relatively politically stable language is important, though obviously not the only factor. I think the best one could hope for is a lot of diverse groups with different political views and motivations being invested in the future of a language, so that despite any culture war stuff, there's likely to be a useful version that survives.
Politics will creep into anything, if one allows that to happen.
New potential language feature: "Not created nor maintained by Americans". ;) (/s)
Though that in itself potentially opens up other cans of worms, some of which could also be not good.
Whatever your goal is, it's worth your time as i see it.
I asked my mom who used to audit businesses what was important about founders and CEO's and she said they more than anyone else set the companies culture. I feels to me like that seems to be true of the culture surrounding various programming langs.
I'm having a real hard time seeing this unfold among the greybeards that call the shots in Java or C++.
Rust is a great language with a lot of advantages and is absolutely worth considering for your next project.
That being said, my recommendation for learning systems programming would be to consider trying plain old C first. Rust's safety features are a godsend, but IMO easier to understand once you have experienced working without them. (Similarly, I like to recommend leaning a dynamically typed language first, and introducing static typing later.)
Also, side note: C != C++.
the stdlib could have like ~5 ease of life things (linked list, hashmap come to mind) that would have made a world of difference in my opinion
Also once you learn C, you never lose C. C will still be around, and it's good knowledge, it's not wasted knowledge. C doesn't really change anymore. You can take it to the grave.
C forces you to have a good understanding of what the hardware does compared to high level languages, but without the assembly grind.
Passing around a pointer becomes passing around a borrow or a Mutex<T> or Arc<Mutex<T>>.
Not sure how you'd summarize Rc<T> or Box<T>
Want to pass and modify data from and to multiple threads? Yea just drop an Arc<Mutex<T>> and you're good to go. If you just want to pass some data, even around threads, without modifying it, then a plain old borrow is your best bet. Make sure to get the lifetimes right tho!
Further, I've noticed a trend highlighted by people such as Jonathan Blow that there are users of Rust who don't fully understand object lifetimes in particular systems and are hacking around warnings in Rust creating unsafe memory scenarios while being told otherwise because all of their compiler messages have disappeared.
Some things in software engineering are hard, but you can't escape them. It seems like you can only defer the problem until you actually need to understand what's going on, and by the time you realize that, you'll be deep in experience with "weird holes" in your knowledge (as I fondly remember a (pre-?)algebra teacher telling me when I was discussing quaternions in middle school.)
Personally, I think Rust is the future of systems programming and there's no more reason to learn C / C++ than there is a reason to learn FORTRAN or COBOL (specifically, the reason is only ever "I need to get a job using those languages"). But, you know, feel free to take that with a grain of salt and see for yourself.
Rust isn't going anywhere any time soon given how many big companies use it, so even if you learn C/C++ first, you'll likely need to learn rust as well eventually if you want to do systems stuff.
I don't understand this way of using technology or being in this profession; self promotion and dialogue through twitter, blog posting all over the place, conferences, panels, books, speaking tours, ego & self promotion all built around particular tools.
In the end these are tools for writing software and we get paid. Is Rust a better tool that some others? Yes, and it's what I'm working with these days. But it's not a lifestyle, and it should not be a culture/subculture. Other professions don't generally talk this way about their tools, why are certain people in software like this?
To answer the question: Rust is a good systems programming language. But I will say this: many of the people piling into it right now don't actually need Rust.
In my experience, these people and their projects tend to be more interesting.
But I don't do twitter, or the conference circuit, or blog. And I learned long ago to stay away from committee & project politics.
Programming being a lifestyle means programming, not self-marketing or getting into turf wars.
C++ is fine and has a lot of libraries built up — especially around image processing. It will be quite some time before Rust replaces C++. But if I had time to learn only one sugary C, it’d be Rust.
Seems offhand
But Rust is catching up in that space and has a lot going for it in terms of ergonomics and safety. The fact that you often have the "if it compiles it works" experience (provided you leverage the type system) is such a good thing. It is just a nice language for certain things.