Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Malidir
· 2y ago · 0 comments
Would Rust and it's memory safety stuff have prevented this?
Comments
[–]
Squeeze2664
2y ago
In some sense, yes. Use-after-free is impossible in safe Rust (if you don't use the unsafe keyword)
[–]
ramon156
2y ago
I'd argue that this is a good example of how rust could've prevented use-after-free, but y'know, I'd obviously be glazing.
[–]
wslh
2y ago
It's not as easy as everyone might think. You could take a look at this thread titled 'My big problem with Rust is too much "unsafe" code' [1].
[1]
https://news.ycombinator.com/item?id=41792477
[–]
xwolfi
2y ago
Java too !
[–]
yencabulator
2y ago
The difference being that no one in their right mind is thinking of rewriting a browser in Java to also make it faster, while that's exactly what Servo/Stylo etc are all about.
[–]
bubblesnort
2y ago
And don't forget Ada.
[–]
Yoric
2y ago
And OCaml or Haskell :)
[–]
sph
2y ago
Why go fancy? Even Python saves you from use-after-free.
[–]
jeltz
2y ago
Brainfuck too!