Let's not get overboard here
That's very far from truth.
Rust does make guarantees about certain kinds of safety, when not using unsafe {} blocks. You get memory safety and freedom from data-race issues. I don't know if any other languages offer that without incurring runtime costs.
Slow rust code is also possible, but your code can't really be slow because it is written in rust, in the same way that c doesn't get in the way of performance.
This should be applied to your original unsubstantiated claim.
Rust has some features that improve safety. Writing code in Rust does not generate safe code.
I mean philosophically you could say there is no safe code, but then what’s the point of any language improvement.
Perhaps you mean that Rust has unsafe, which allows you to write unsafe code in Rust. But technically that term is reserved for the developer to make a claim that though the compiler can’t determine the safety of this code, the developer is claiming it is safe.
Then there is safe Rust, if you write safe Rust, the guarantees that the program output is safe are pretty high. Given that no software is devoid of bugs, it’s obviously not 100%.
So do you have a specific argument your making about why Rust is not safe? Or is it a general comment about software?
Edit: I suppose you could be pedantic in that rustc doesn’t generate code, but technically it does, mir and then llvmir. That code then gets compiled to platform specific binaries.
I have been writing safety critical code for living, so I think that saying that code "is safe" because it is written in some language is categorical error (not just error of degree) unless it is a language enables formally proofing correctness.
You can take fundamentally unsafe language like C. Restrict to subset of it MISRA C and use external static code analysis like Astree that that uses abstract interpretation to prove that there are no run time errors: no memory errors, no division of zero erros, no out-of-bounds array indexing, floating-point or integer overflows, loops always terminate, floating point rounding errors stay within specified limits etc. Something that Rust does not have.
Rust has some potential and there are some companies that attempt to provide tooling to make it possible to write safe Rust code, but it's not there yet.
my meaningful contribution is a first hand account of my experience with a variety of the aspects of using rust. one potentially imprecise sentence doesn't negate that contribution. you on the other hand with completely contentless sentence fragments are contributing absolutely nothing to the conversation.
There is power and freedom in the act of letting go of former actions and moving forward, from time to time. If someone judges you for making a small mistake, maybe they are the one with the issue.
This is a lesson I'm still practicing as well, so this comment is just as much a reminder to myself.
That's a tradeoff that bothers a lot of people who hear the Rust hype, only to find that it's more annoying to write the things they want to write. But if you use Rust and it makes a very hard thing possible, this is an incredibly empowering experience and you'll become a passionate believer. This is a dynamic that leads to arguments on the internet.
I've never done any substantial low-level systems programming, but there are high-level situations where I think Rust was better than anything else.
In one case, I simply couldn't get decent performance for something out of any garbage collected language I tried -- and GC time was the actual bottleneck. Rewriting in C++ seemed very intimidating and likely to be error-prone. Doing the same thing in Rust gave me the same benefits with the confidence that I hadn't made any dumb memory errors.
The second benefit of Rust is that concurrency and parallelism is easy, in the sense that 1) for basic parallelism, you can use Rayon without even thinking about it, and 2) in more complex cases, you can share stuff across threads and be confident that you haven't introduced any weird, hard-to-debug race conditions.
From what I’ve seen, Rust prioritizes improvements in this order:
Refactoring code can be one of the hardest but most beneficial things a dev can do for a code base, so let’s make that simpler.
Reading code is done 10x more than writing code, so let’s make that intuitive.
Writing code can be tedious, how do we help make things ergonomic.
What this means is that the mentality of a weekend project, or any code you will write once and forget about is the worst way to try out Rust.
I’d recommend trying Rust twice. Once to create the first draft that might be shitty. Then again in a week or month to refactor that same code.
I appreciate it's approach to type safety and pattern matching, in fact, I find it pretty annoying to write code in a language that doesn't at least have sum types, pattern matching, and some kind of parametric/ad hoc polymorphism (Rust's traits feature).
Another nice thing about Rust is you can be pretty confident when writing multithreaded code. One of the slogans is 'fearless concurrency', and I think it lives up to that. I can write some little tool that does a bunch of things in parallel and know at compile time that I won't have any data races.
The tradeoff is that if you haven't written a lot of code in a lang with a similar type system, it can seem daunting.
Horses for courses.
To paraphrase your question, you are essentially asking: "Why should I use language Y instead of X when X is fast enough for me, easier for me to read, and based on experience I like it better?" My immediate thought is that it sounds like language X is working quite well and aside from satisfying your personal curiosity there's no imperative to make that switch!
But sometimes it is not fast enough, and rust hits that sweet spot I need, offering both extreme speed (you can hardly go any faster in execution speed or memory management) and good enough productivity (something I can't achieve in C or C++ for various reasons, although they would be my second choice if I couldn't use rust for some reason).
So, I tend to use rust for not-super-low-level stuff (quite the opposite, actually), but this is somehow a last-recourse choice for me (I'd rather use go if I can, for productivity reasons).
I actually like the ergonomics of it a lot and have learned to satisfy the borrow checker. I would use it over Java for almost anything.
The biggest downside to me is the long iteration times when making a change, compiling, and testing repeatedly.
I've missed this property when writing Java and JS even before Rust was a thing, and Go has felt the same.
Go has google behind it, so regardless of anyone's opinion they can very well jam it down everybody's throat through sheer throwing money at the problem.
Go was build for fast web servers, not for what Rust is aiming for at all.
Rust also has this this obnoxious issue around it that has become a meme :
https://transitiontech.ca/random/RIIR
Rust CAN be a good choice for building a bluetooth driver or writing the logic for pacemaker (oh god no !).
But it has the steepest 90 degree hill to climb mainly because :
- untested in the wild.
- lack of libraries.
- API stability.
You should keep on using Go due to it being better tested, unless some large company throws a few billion dollars behind it, its going to take a lot of time for Rust to catch up on its own.
I bet even by 2025 rust wont get much traction unless some bigCo heavily invests in it, do not take my word for it - just look at purely open source projects like FreeBSD, Linux took nearly 20+ years to get any traction.
This is a 100% false statement. Here’s a list: https://www.rust-lang.org/en-US/friends.html
I’ve been really impressed with how much success people have had with cross platform deployments as well. At RustConf we just saw a talk about one company putting Rust on satellites, doesn’t get more “wild” than that.
> - lack of libraries.
There are some gaps. But new libraries are showing up every day. For middle of the road, non-exotic stuff, I would be surprised if a developer doesn’t have everything they need.
> - API stability.
In the library ecosystem this is a small problem. In the past 3 years I rarely am broken from library upgrades. For the language though, I have never in the same 3 years been broken by a language upgrade. Not to say there haven’t been bugs that the language needed to fix, but stable has never failed to compile my oldest Rust 1.0 code.
Please don’t spread information ignorant of facts.
As for the rest of your argument: in many companies people is still moving to C11 or C++11. For many, software is considered for production only if it has been 5 years in the wild. A library appearing on cargo does not mean it is “available”.
> For many, software is considered for production only if it has been 5 years in the wild.
Time is irrelevant, it’s about usage and stability. Every rust crate I rely on has published download numbers, which give you an idea of number of people using it. In that set, they are all open source and published on GitHub or Gitlab, so I can look at the codebases easily.
You can wait, that’s fine. But you do end up missing out on helping shape a new environment that is growing at crazy rates over the last few years.
If you think “download numbers” (or open source, or being in GitHub) is a good metric for measuring reliability, it means you haven’t really worked in any such field.
It isn’t growing _at all_ in many fields, because it is simply way too new (no new software projects started on it), it isn’t certified (or even impossible to certify). That does not mean it is not better, so don’t take that as an attack. It is simply a suicide in risk-analysis to use a new language, new libraries and new compiler front-end in safety-critical projects; so it is a no-go. Similarly for C11, C++14, C++17 and many other languages, frameworks and libraries that you have to approve.
I never have worked in such a field, and you're comments about certification, etc, are definitely things I will accept as true. Getting any support of new technology in any space is hard, and of course takes time.
But, I will say that "download numbers" where there is obvious sustained usage of a project is a stand-in for understanding if something is seeing real-world usage. I don't claim that it show stability, only that if it's usage is high and the number of issues on the project are not growing under that strain then you can begin to get a picture of it's stability.
When you talk about formal proofs, certification, etc. Those are different mechanisms for validating that, but generally requires substantial amounts of money to be done.
However, from plans to actual usage takes years; specially for completely new projects using new languages, compilers, libraries, etc. in safety-critical stuff, that takes months just to validate.
Stating anything else is just either lying (marketing) or ignorance. Please do not do a disservice to your language by creating vacuous hype.
As for flamewars, what are you even talking about? I have not said a single thing in favour of any language. Have you read the thread?
This is bullying: "Prove Rust is controlling critical systems _today_ ".
And this breaks the site guideline against calling names in arguments, as well as returning to personal attack: "Otherwise, please stop spreading bullshit".
Please review https://news.ycombinator.com/newsguidelines.html. Your comments need to be considerably more respectful if you want to keep posting here. There are plenty of ways to express your views about programming languages thoughtfully, including if you disagree with someone. It's not hard, if you take the spirit of this site to heart. We'd appreciate it if you'd do that.
As for the rest: I don’t see how asking for proof can be considered “bullying”.
Please review the definition of bullying, because you are trivializing it and therefore hurting actual victims of bullying.
Thank you on behalf of them.
Finally, since it seems HN are in the business of deleting fair comments, I will leave the site and do my best warn others of what is happening here.
Good luck.
I'm not really gonna bother to reply when there's accusations like this.
I do understand everything you're saying. We're not in disagreement about the context. I (or more accurately, bluejekyll, we're talking about the same thing) did provide such a citation, you can take it or leave it.
Facebook is too.
Amazon had a booth, I didn’t get a chance to talk to them about their current deployment personally.
Don’t underestimate China either, PingCap has huge deployments of their database, and while we may not hear about them often in the West, the numbers don’t lie.
Mozilla is comparatively not a financial heavy weight like google, Microsoft.
Google has a history of doing a million things that fail, but that is exactly what i mean. They can spam the programming community with millions of things and something will eventually stick. Moz doesn't have that type of financial firepower so for them it's Rust or bust.
Every time I start a new personal project I say 'oh neat I can use Rust!' N hours later (where N is a large number) I realize Go is about as fast, much easier and more readable syntax, and so I use Go if I want something that isn't Node. I'm a web developer so maybe Rust just isn't useful for that, but is Rust purely a systems level language for making super low level stuff? Forgive my ignorance, but what do people actually use it for where it outshines other languages?