219 points formerly_proven 2 hours ago 93 comments
vincent-uden 1 hour ago | parent
LoganDark 1 hour ago | parent
jvanderbot 1 hour ago | parent
bryanlarsen 1 hour ago | parent
neysofu 1 hour ago | parent
gspr 57 minutes ago | parent
rvz 13 minutes ago | parent
This is the problem when a language advertises with “guarantees” and it turns out it never had any due to many false assumptions by their promoters.
So what other soundness bugs are there in the language that we need to know about?
jvanderbot 10 minutes ago | parent
For some reason this is controversial, but it remains true.
cmrdporcupine 7 minutes ago | parent
But not custom drops that are doing variadic type stuff like this, usually.
cmrdporcupine 7 minutes ago | parent
That it took 11 years for someone to come across this is a fairly intense counterargument to your attempt to paint this as a language with dangerous footguns.
insanitybit 1 hour ago | parent
The reality is that if this were actually code that people wrote, well, it wouldn't have sat around for a decade.
fg137 19 minutes ago | parent
The fact that nobody reported this before means it's not, by definition.
cowlevel 1 hour ago | parent
insanitybit 1 hour ago | parent
Safe rust is safe, granting `unsafe` and compiler errors. This isn't a secret.
high_na_euv 1 hour ago | parent
cowlevel 1 hour ago | parent
qweqwe14 1 hour ago | parent
high_na_euv 51 minutes ago | parent
it has been discussed bilion times
david-gpu 1 hour ago | parent
cowlevel 1 hour ago | parent
lkey 52 minutes ago | parent
cowlevel 47 minutes ago | parent
beanjuiceII 39 minutes ago | parent
uniqueusername7 21 minutes ago | parent
Ukv 25 minutes ago | parent
Specifically the `q.0 = Some(&l);` violating 4.15.2:40 ("An assignment expression requires that the type of its value operand is a subtype of the type of its assignee operand.")
csande17 42 minutes ago | parent
mrkeen 1 hour ago | parent
afdbcreid 58 minutes ago | parent
cowlevel 47 minutes ago | parent
Hugsbox 1 hour ago | parent
lelanthran 1 hour ago | parent
Maybe they wrote it in C :-)
On a serious note, old software is generally more trustworthy than new software, because bugs are discovered over time and with usage.
zaphar 50 minutes ago | parent
fg137 18 minutes ago | parent
FuzzywarmWalnut 1 hour ago | parent
MrBuddyCasino 1 hour ago | parent
struct Q<T: 'static>(Option<T>);
impl<T: 'static> Drop for Q<T> {
fn drop(&mut self) {
// Code in here has access to a non-'static &String
// but assumes that it's a &'static String
}
}
fn main() {
let l = String::new();
let mut q = Q(None);
q.0 = Some(&l);
}
I wonder if the certified compiler for safety critical uses (edit: Ferrocene) has the same issue.wg0 1 hour ago | parent
jug 1 hour ago | parent
afdbcreid 1 hour ago | parent
wg0 1 hour ago | parent
Most LLMs would probably say this piece of code won't compile.
ChickeNES 31 minutes ago | parent
afdbcreid 1 hour ago | parent
It uses the same code, so yes.
(Although I don't know what are their guidelines, it might be that they require avoiding code relying on implied bounds, for example).
1718627440 26 minutes ago | parent
thinkharderdev 5 minutes ago | parent
badatnames 1 hour ago | parent
zer00eyz 1 hour ago | parent
I will happily continue to write things in Golang first. I don't enjoy refactors in Rust, and it's rare that I see things that genuinely need its raw performance.
Cloudflare's Oxy is a stellar example of build in Golang till your design is settled and then port over for performance when you need it.
akoboldfrying 1 hour ago | parent
ETA: Downvoters, I salute you. Without your selfless courage, the forces of light humour would surely prevail.
rvz 1 hour ago | parent
mrlonglong 1 hour ago | parent
wg0 53 minutes ago | parent
fg137 31 minutes ago | parent
akoboldfrying 13 minutes ago | parent
Philpax 21 minutes ago | parent
mrkeen 1 hour ago | parent
I gave it a quick scan for Rust examples; there are 11 samples among the following pages:
https://counterexamples.org/eventually-nothing.html
https://counterexamples.org/mutable-matching.html
https://counterexamples.org/selfishness.html
https://counterexamples.org/scope-escape.html
https://counterexamples.org/nearly-universal.html
The first thing I always look for is mutability (combined with some other tricky feature), e.g. "Now it's a Just(3):Maybe<Int>, now it's a Nothing:Maybe<Int>, now it's a Nothing:Maybe<String>."I wonder if TFA's example could be reproduced without mutability.
vrighter 40 minutes ago | parent
thfuran 33 minutes ago | parent
AnimalMuppet 5 minutes ago | parent
csande17 28 minutes ago | parent
Rust cannot fail, it can only be failed.
lolakutty 17 minutes ago | parent
Sweet. But why should anyone care..
UncleMeat 10 minutes ago | parent
insanitybit 5 minutes ago | parent
roblabla 24 minutes ago | parent
Also, a lot of those soundness issues aren't related to new features _at all_, but usually due to poor assumptions made in optimizations.
The soundness bugs _are_ taken seriously though, and are slowly being patched out. A lot of the links in OP are now closed because Rust either changed how it generates code to avoid the issues, or fixed LLVM.
jeremyjh 24 minutes ago | parent
carlmr 5 minutes ago | parent
You can be annoyed by Rust fanboys, sure, but the more annoying are the Rust haters, because the hate always comes from a place of ignorance.
The hate only works if you don't go beyond a surface level understanding of Rust.
E.g. a niche case on the borrow checker is slightly broken, so borrow checking doesn't make sense.
Or the "oh but Rust needs unsafe, so it's just like C++".
Yeah, but by that measure all of C++ is unsafe++, even unsafe has more guarantees than standard C++.
Only if your whole understanding of the concept is that the keyword is called "unsafe", does that argument make sense.
A bit of a rant, but if you hate Rust with a passion, ask yourself first where that opinion comes from and if it can stand on its own. In most cases it can't.
UncleMeat 11 minutes ago | parent
rvz 1 hour ago | parent
EDIT: I don’t even think HN cared either up until now. If you search this paper on HN, guess who posted it?
optionalsquid 1 hour ago | parent
So I don't think it's fair to claim that "no-one cared".
purplesyringa 1 hour ago | parent
JABVOLT 1 hour ago | parent
j4k0bfr 46 minutes ago | parent
beanjuiceII 45 minutes ago | parent
lambdaone 45 minutes ago | parent
The eventual formalization of Rust and a creation of a formally proven compiler is presumably going to be the end point of this process.
bbor 36 minutes ago | parent
https://www.lesswrong.com/posts/zHhGa3iQBQcdSifFL/a-critical...
kimi 23 minutes ago | parent
fnord77 39 minutes ago | parent
With this you have to recompile everything
baq 12 minutes ago | parent
weinzierl 22 minutes ago | parent