Decent C and C++ developers shouldn't take that long to grasp the borrow-checker. Those that don't can't be trusted coding C or C++ in the first place. Because they don't have a good enough mental model of memory management to deal with it manually.
Interop with C is fairly straightforward. Python also with PyO3. C++ has some support.
> There may also be a few problem domains that demand the maximum performance and lowest resource utilization possible
You can approach that with Rust as well. Often you can even do performance improvements better and safer then in C++, because the borrow checker helps you stay safe. Especially CoW is a godsend when processing data.
In fairness to C and C++ developers: while often the problem is not understanding memory management, sometimes the problem is understanding it and having a model that doesn't mesh with borrow checking, or having a problem that needs some additional work to map into something easy to write in safe code. For instance, it takes some additional knowledge in Rust to know that if you want to build a graph, you 1) should almost always use an established graph library and not write your own, and 2) if you do need to write your own graph, you either need to use Rc, have an array of nodes and use indices, or use unsafe and raw pointers and provide a nice safe well-tested wrapper.
(I'm one of the developers of Rust, and I think it's important to characterize languages fairly.)
And coming from C++, Rc is not such a foreign concept compared to smart pointers.
Coming from C it might be a bit more of a foreign concept I'll admit.
> Productivity
> Readability
> Performance
> Static binaries
> Not needing PhD in rust, especially async rust
Rust works fine as high level language but it's absolutely awful for anything else and suffers from C++ feature creep. It would be a much better language if rust wasn't afraid of making `unsafe` an useful tool rather than thing that "everyone expect the core devs should absolutely avoid". Ergonomics would increase tenfolds if you could use it to essentially control the borrow checker better as well instead having to do mega abstractions (which aren't often zero-cost even) or hoops for every single thing.> not be allowed to use any rust that uses unsafe()
Not allowed by whom? What's made you assume your computer will be policed for non-memory-safe code?
IMHO, at least for many things, such as IT systems controlling fundamental public functions (e.g., DNS), services (e.g., electrical grid), dangerous machines, etc., our engineering should be held the same standards as bridges, airplanes, etc.
Look at the endless problems and costs caused by our crappy quality: National security harms and risk, privacy violations, endless fraud, systems that are almost impossible to adequately secure.
This hacker news, after all. Hackers built this stuff, and they laugh at the bureaucrats who try to make rules to control it.
> our engineering should be held the same standards as bridges, airplanes, etc
In principle, I'd agree. BUT that's only going to happen when the practitioners have the ability to say "no" to bad designs and short deadlines. Which requires some kind of professional engineering certification, and requirements that only certified software engineers be allowed to do certain things, and certified software engineers that actually have the guts to say no.
Lacking that, we'd just have to regulate the designs themselves - and, as soon as government regs get their hands on any software design, I guarantee you innovation of those designs will freeze. (Same reason why innovation of private aircraft has frozen - the cessna, the most popular private aircraft, is an eighty year old design because innovation is virtually impossible, because regulations, because safety.)
> Look at the endless problems and costs caused by our crappy quality: National security harms and risk, privacy violations, endless fraud, systems that are almost impossible to adequately secure.
Yes, but look at the incredible pace of innovation which the lack of regulation has allowed: web browsers, operating systems, word processors, scripting languages, world-wide communication and freedom from oppression. You can't stop the signal.
Even the IT industry is much more mature than that. That and the rest of the comment are an old fantasy that reality left behind long ago. Look at the reality of these things:
> Yes, but look at the incredible pace of innovation which the lack of regulation has allowed: web browsers, operating systems, word processors, scripting languages, world-wide communication and freedom from oppression. You can't stop the signal.
An inverse relationship between pace of innovation and regulation is an unsupported claim by people who simply want to do whatever they like and/or want unrestricted personal
Of course some regulation could impede innovation, while some could greatly improve it. Imagine innovation in privacy, for example, because regulations require it, rather than ignoring privacy because it's almost entirely unregulated (in the US).
> innovation which the lack of regulation has allowed: web browsers, operating systems, word processors, scripting languages, world-wide communication
All those innovations go back to the 1990s.
> freedom from oppression. You can't stop the signal.
In fact, oppression has increased and democracy and freedom have retreated for the last 20 years. Many SV leaders are against or ambivalent about democracy, and push anti-democratic narratives (which favor giving more power to them, of course).
End-user control, including freedom-as-in-speech, in IT is almost a forgotten issue. And once the oppressors got the hang of it, they now very ably use the Internet and other technology to conduct effective information warfare directly against the public.
The IT industry is like the average googler - competent enough to use the tools designed for them. They aren't who I'm talking about.
> an unsupported claim by people who simply want to do whatever they like
The claim that regulation doesn't hamper innovation is an unsupported assertion of control freaks. And regulation that directs innovation only does so because it makes alternative innovations harder - not because it makes certain innovations easier.
> All those innovations go back to the 1990s.
Don't take such things for granted. Their age makes them no less relevant; regulation would have killed them just as easily as chatgpt. I picked old tech as examples because their benefit to the world - and the lax regulatory environment they were created in - are both incontrovertible. That makes them no less examples of innovation.
> oppression has increased and democracy and freedom have retreated
One of the best weapons to implement these kinds of changes are an ever-increasing regulatory burden. Small wonder that's increased alongside the harms you describe.
> misinformation
Everyone does it, everyone gets fooled by it, everyone thinks they're special. More signal, more information - not less - is the only hope for a solution there.
But that's not what I meant. I meant that I have gcc on my laptop, and I can compile code there that runs on linux, and no one can stop me from writing code and sharing it. But they can add ever greater regulations to the infrastructure involved until the friction kills the community.
Much of that gcc-on-Linux compiled code is absolute crap (generally, not yours), as we can see by the outcomes. We need much higher standards for anything engineered for the public.
>> oppression has increased and democracy and freedom have retreated
> One of the best weapons to implement these kinds of changes are an ever-increasing regulatory burden.
Could you give an example? China, Russia, Hungary, Turkey, India, etc. are not known for their regulatory burdens. The EU has plenty of regulation and is arguably the leading region for democracy.
> The claim that regulation doesn't hamper innovation is an unsupported assertion of control freaks. And regulation that directs innovation only does so because it makes alternative innovations harder - not because it makes certain innovations easier.
I didn't say regulation doesn't hamper innovation, I said it depends on the regulation. Some regulations make innovation easier; for example, standardized Internet protocols fostered incredible innovation, instead of everyone reinventing incompatible wheels.
Which outcomes? safety or productivity? Because all kinds of useful stuff is built in an unsafe manner.
> We need much higher standards for anything engineered for the public.
I think you're imagining a world where the same software exists, but safer. What you would actually get is far less useful software.
> Could you give an example? China, Russia, Hungary, Turkey, India, etc. are not known for their regulatory burdens.
But the US and UK are, increasingly so. Voter registration makes it harder to vote. Backdoor requirements in messaging apps (like what the UK tried to pass recently) can be used to target journalists and limit our freedom of speech. Misinformation regulations can be misused for censorship (which facts are wrong/inconvenient? let the government decide). And recently on HN - regulations on AI safety are being pushed by the incumbent players (e.g openai) to keep out new ones.
> The EU has plenty of regulation and is arguably the leading region for democracy.
And is far, far behind on innovation. Mistral and deepmind are rare counterexamples on the long tail of the bell curve.
> Some regulations make innovation easier; for example, standardized Internet protocols
Do you mean the IETF? Because that's not a government nor regulatory body. It's a great example of the actual engineers involved, not bureaucrats, working together outside of regulatory bodies to make stuff work.
> I didn't say regulation doesn't hamper innovation, I said it depends on the regulation.
>> An inverse relationship between pace of innovation and regulation is an unsupported claim by people who simply want to do whatever they like and/or want unrestricted personal
Yeah, you kinda did.
[1]: https://www.flightsafetyaustralia.com/2018/11/one-thing-at-a... (interestingly, I would argue that Boeing Model 299 being able to be accelerated enough to lift off while gust locks were engaged were was a design failure, and points towards the need for safe-by-design mechanisms, even for experienced operators.)
[2]: https://en.wikipedia.org/wiki/Contemporary_reaction_to_Ignaz...
I often see people likening software development with woodworking, which is funny because I think our industry is still at at the "you're not a real carpenter unless you're missing three fingers" stage.
I think the real subject being discussed here is the viability of Rust for applications which are traditionally a good fit for C and C++. I think it would be better to be specific about that.
The point of memory safe languages is not to not have unsafe code. It is to centralize unsafe code in a few places that can be thoroughly audited, tested, and verified, and then provide safe abstractions on top of that.
Inb4 this is only a recommendation: regulation often starts as recommendation trial balloons
Memory safety is very weak in Rust, IMO. Memory errors are only one kind of error, and users of other languages have invented many brilliant ways to avoid and fix issues. It would be better to focus on detecting and preventing errors than rewriting IMO.
Put differently, a developer can grok how to properly manage memory, but we’ve found that trying really hard to get it right does not scale. Even if you’re an expert. We need tools to check our work.
Within another couple years, automated systems that are descendants of today's rapidly-advancing coding-assistant LLMs will be able to do amazing things.
For example, it's plausible they'd be able to to create proven-memory-safe rewrites of older software, with verified drop-in compatibility for all enumerable use-cases, practically for free.
Well, unless it's a parasitic government contractor doing the work.
Yeah I'll believe it when I see it. If humans struggle to figure out what these systems are supposed to do, no AI is going to figure it out.
Hundreds of billions of dollars is a lowball estimate on what it would take to rewrite it all in Rust.